Fixed invalid parameter name in DCSEx.zones.getAirbases

This commit is contained in:
Ambroise Garel 2025-09-16 22:15:53 +02:00
parent d0355af8e3
commit 83ddfe7598

View File

@ -2,7 +2,7 @@
-- DCSEX.ZONES - FUNCTIONS RELATED TO MAP TRIGGER ZONES -- DCSEX.ZONES - FUNCTIONS RELATED TO MAP TRIGGER ZONES
-- ==================================================================================== -- ====================================================================================
-- DCSEx.zones.drawOnMap(zoneTable, lineColor, fillColor, lineType, drawName, readOnly) -- DCSEx.zones.drawOnMap(zoneTable, lineColor, fillColor, lineType, drawName, readOnly)
-- DCSEx.zones.getAirbases(zone, coalition, allowShips) -- DCSEx.zones.getAirbases(zone, coalID, allowShips)
-- DCSEx.zones.getAll() -- DCSEx.zones.getAll()
-- DCSEx.zones.getByName(name) -- DCSEx.zones.getByName(name)
-- DCSEx.zones.getCenter(zoneTable) -- DCSEx.zones.getCenter(zoneTable)
@ -77,19 +77,19 @@ end
-- Returns all airbases in the zone -- Returns all airbases in the zone
------------------------------------- -------------------------------------
-- @param zoneTable Table of the zone in which to search -- @param zoneTable Table of the zone in which to search
-- @param coalition Coalition (from the coalition.side enum) the airbase must belong to. Default is nil, which means "all coalitions" -- @param coalID Coalition (from the coalition.side enum) the airbase must belong to. Default is nil, which means "all coalitions"
-- @param allowShips Should ships be allowed? -- @param allowShips Should ships be allowed?
-- @return Table of airbases -- @return Table of airbases
------------------------------------- -------------------------------------
function DCSEx.zones.getAirbases(zoneTable, coalition, allowShips) function DCSEx.zones.getAirbases(zoneTable, coalID, allowShips)
coalition = coalition or nil coalID = coalID or nil
allowShips = allowShips or false allowShips = allowShips or false
local coalitions = { coalition.side.RED, coalition.side.BLUE } local coalitionSides = { coalition.side.RED, coalition.side.BLUE }
if coalition then coalitions = { coalition } end if coalID then coalitionSides = { coalID } end
local validAirbases = {} local validAirbases = {}
for _,side in ipairs(coalitions) do for _,side in ipairs(coalitionSides) do
for _,ab in ipairs(coalition.getAirbases(side)) do for _,ab in ipairs(coalition.getAirbases(side)) do
local abDesc = ab:getDesc() local abDesc = ab:getDesc()
local isValid = true local isValid = true