linter fixes
This commit is contained in:
@@ -77,7 +77,7 @@ do -- INIT DCS_UTIL
|
||||
do -- INITS ALL TABLES WITH DATA THAT's from the MIZ environment
|
||||
|
||||
do --init trigger zones
|
||||
for i, trigger_zone in pairs(env.mission.triggers.zones) do
|
||||
for _, trigger_zone in pairs(env.mission.triggers.zones) do
|
||||
-- reorder verts as they are not ordered correctly in the ME
|
||||
local verts = {}
|
||||
if Util.tableLength(trigger_zone.verticies) >= 4 then
|
||||
@@ -192,7 +192,7 @@ do -- INIT DCS_UTIL
|
||||
BLUE = 2
|
||||
}
|
||||
]] --
|
||||
local input = string.lower(input)
|
||||
input = string.lower(input)
|
||||
if input == 'neutrals' or input == "neutral" or input == "0" then
|
||||
return DCS_UTIL.Coalition.NEUTRAL
|
||||
end
|
||||
@@ -235,7 +235,7 @@ do -- INIT DCS_UTIL
|
||||
end
|
||||
end
|
||||
|
||||
for index, zone_name in pairs(zone_names) do
|
||||
for _, zone_name in pairs(zone_names) do
|
||||
local zone = DCS_UTIL.__trigger_zones[zone_name]
|
||||
if zone then
|
||||
zones[#zones + 1] = zone
|
||||
@@ -247,7 +247,7 @@ do -- INIT DCS_UTIL
|
||||
local lUnit = units[units_ind]
|
||||
local unit_pos = lUnit:getPosition().p
|
||||
local lCat = Object.getCategory(lUnit)
|
||||
for zone_name, zone in pairs(zones) do
|
||||
for _, zone in pairs(zones) do
|
||||
if unit_pos and ((lCat == 1 and lUnit:isActive() == true) or lCat ~= 1) then -- it is a unit and is active or it is not a unit
|
||||
local isInZone = Util.is3dPointInZone(unit_pos, zone)
|
||||
if isInZone == true then
|
||||
@@ -313,7 +313,7 @@ do -- INIT DCS_UTIL
|
||||
function DCS_UTIL.isPositionInZones(x, z, zone_names)
|
||||
---@type Array<SpearheadTriggerZone>
|
||||
local zones = {}
|
||||
for index, zone_name in pairs(zone_names) do
|
||||
for _, zone_name in pairs(zone_names) do
|
||||
local zone = DCS_UTIL.__trigger_zones[zone_name]
|
||||
if zone then
|
||||
zones[#zones + 1] = zone
|
||||
@@ -321,7 +321,7 @@ do -- INIT DCS_UTIL
|
||||
end
|
||||
|
||||
local result_zones = {}
|
||||
for zone_name, zone in pairs(zones) do
|
||||
for _, zone in pairs(zones) do
|
||||
if Util.is3dPointInZone({ x = x, z = z, y = 0 }, zone) == true then
|
||||
result_zones[#result_zones + 1] = zone.name
|
||||
end
|
||||
@@ -414,7 +414,7 @@ do -- INIT DCS_UTIL
|
||||
local height = land.getHeight(location)
|
||||
local vec3 = { x = location.x, y = height, z = location.y }
|
||||
|
||||
local unitType = string.lower(unitType or "")
|
||||
unitType = string.lower(unitType or "")
|
||||
local conversionType = config[unitType]
|
||||
|
||||
if not conversionType then conversionType = "DDM" end
|
||||
@@ -471,7 +471,7 @@ do -- INIT DCS_UTIL
|
||||
lon_hemisphere, math.abs(lon_deg), lon_min_display, lon_sec_display,
|
||||
altitude * 3,28084)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
---@param zone SpearheadTriggerZone
|
||||
@@ -574,7 +574,7 @@ do -- INIT DCS_UTIL
|
||||
local units = {}
|
||||
for i = 0, 2 do
|
||||
local players = coalition.getPlayers(i)
|
||||
for key, unit in pairs(players) do
|
||||
for _, unit in pairs(players) do
|
||||
units[#units + 1] = unit
|
||||
end
|
||||
end
|
||||
@@ -617,8 +617,7 @@ do -- INIT DCS_UTIL
|
||||
end
|
||||
|
||||
function DCS_UTIL.CleanCorpse(unitName)
|
||||
local unitName = "dead_" .. unitName
|
||||
|
||||
unitName = "dead_" .. unitName
|
||||
local object = StaticObject.getByName(unitName)
|
||||
|
||||
if object then
|
||||
@@ -632,11 +631,11 @@ do -- INIT DCS_UTIL
|
||||
---@field b number
|
||||
---@field a number
|
||||
|
||||
local drawID = 4210
|
||||
local __drawID = 4210
|
||||
|
||||
function DCS_UTIL.GetNextDrawID()
|
||||
drawID = drawID + 1
|
||||
return drawID
|
||||
__drawID = __drawID + 1
|
||||
return __drawID
|
||||
end
|
||||
|
||||
---@param groupID number
|
||||
@@ -644,9 +643,9 @@ do -- INIT DCS_UTIL
|
||||
---@param location Vec3
|
||||
---@return number markID
|
||||
function DCS_UTIL.AddMarkToGroup(groupID, text, location)
|
||||
local drawID = DCS_UTIL.GetNextDrawID()
|
||||
trigger.action.markToGroup(drawID, text, location, groupID, true, nil)
|
||||
return drawID
|
||||
local nextId = DCS_UTIL.GetNextDrawID()
|
||||
trigger.action.markToGroup(nextId, text, location, groupID, true, nil)
|
||||
return nextId
|
||||
end
|
||||
|
||||
---comment
|
||||
@@ -654,9 +653,9 @@ do -- INIT DCS_UTIL
|
||||
---@param location Vec3
|
||||
---@return integer
|
||||
function DCS_UTIL.AddMarkToAll(text, location)
|
||||
local drawID = DCS_UTIL.GetNextDrawID()
|
||||
trigger.action.markToAll(drawID, text, location, true, nil)
|
||||
return drawID
|
||||
local nextId = DCS_UTIL.GetNextDrawID()
|
||||
trigger.action.markToAll(nextId, text, location, true, nil)
|
||||
return nextId
|
||||
end
|
||||
|
||||
---@param markId number
|
||||
@@ -705,7 +704,7 @@ do -- INIT DCS_UTIL
|
||||
|
||||
---@return number? id
|
||||
function DCS_UTIL.GetNeutralCountry()
|
||||
for name, id in pairs(country.id) do
|
||||
for _, id in pairs(country.id) do
|
||||
if coalition.getCountryCoalition(id) == DCS_UTIL.Coalition.NEUTRAL then
|
||||
return id
|
||||
end
|
||||
@@ -759,7 +758,7 @@ do -- INIT DCS_UTIL
|
||||
function DCS_UTIL.GetPlayerGroupByGroupID(groupId)
|
||||
for i = 0, 2 do
|
||||
local players = coalition.getPlayers(i)
|
||||
for key, unit in pairs(players) do
|
||||
for _, unit in pairs(players) do
|
||||
if unit and unit:isExist() == true then
|
||||
local group = unit:getGroup()
|
||||
if group and group:getID() == groupId then
|
||||
@@ -775,7 +774,7 @@ do -- INIT DCS_UTIL
|
||||
function DCS_UTIL.GetPlayerUnitByID(unitID)
|
||||
for i = 0, 2 do
|
||||
local players = coalition.getPlayers(i)
|
||||
for key, unit in pairs(players) do
|
||||
for _, unit in pairs(players) do
|
||||
if unit and unit:getID() == unitID then
|
||||
return unit
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user