SWAPR v0.0.2

This commit is contained in:
Frank
2019-08-05 18:04:59 +02:00
parent debf784d0c
commit 27a1401ae1
2 changed files with 179 additions and 56 deletions

View File

@@ -361,6 +361,26 @@ function AIRBASE:FindByName( AirbaseName )
return AirbaseFound
end
--- Find a AIRBASE in the _DATABASE by its ID.
-- @param #AIRBASE self
-- @param #number id Airbase ID.
-- @return #AIRBASE self
function AIRBASE:FindByID(id)
for name,_airbase in pairs(_DATABASE.AIRBASES) do
local airbase=_airbase --#AIRBASE
local aid=tonumber(airbase:GetID())
if aid==id then
return airbase
end
end
return nil
end
--- Get the DCS object of an airbase
-- @param #AIRBASE self
-- @return DCS#Airbase DCS airbase object.
@@ -604,7 +624,7 @@ function AIRBASE:GetParkingSpotData(TerminalID)
for _,_spot in pairs(parkingdata) do
local spot=_spot --#AIRBASE.ParkingSpot
self:E({TerminalID=spot.TerminalID,TerminalType=spot.TerminalType})
self:T({TerminalID=spot.TerminalID,TerminalType=spot.TerminalType})
if TerminalID==spot.TerminalID then
return spot
end