This commit is contained in:
Frank
2019-11-27 16:46:03 +01:00
parent 75a7f05761
commit 5ad927d20c
3 changed files with 73 additions and 44 deletions
+4 -40
View File
@@ -102,10 +102,13 @@ end
function RAT2:_CheckQueueSpawn()
for i,_ratcraft in pairs(self.Qspawn) do
local ratcraft=_ratcraft --#RATAC
local ratcraft=_ratcraft --Functional.RatCraft#RATCRAFT
--ratcraft.actype
local departure, parking=ratcraft:GetDeparture()
local destination=ratcraft:GetDestination(departure)
--- Check if
-- Time has passed.
-- Already enough aircraft are alive
@@ -126,45 +129,6 @@ end
-- Spawn functions
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Spawn an aircraft asset (plane or helo) at the airbase associated with the warehouse.
-- @param #RAT2 self
-- @param #RATAC ratcraft
-- @return #boolean If true, ratcraft was spawned.
function RAT2:_TrySpawnRatcraft(ratcraft)
-- TODO: loop over departure airbases.
for _,_departure in pairs(ratcraft.departures) do
local departure=_departure --#RATAC.Departure
local parking=nil
if departure.type==RATAC.DeType.AIRBASE then
-- Get parking data.
local parking=self:_FindParking(departure.airbase, ratcraft)
-- Check if enough parking is available.
if parking then
self:_SpawnRatcraft()
return true
end
elseif departure.type==RATAC.DeType.ZONE then
end
end
return false
end
--- Spawn an aircraft asset (plane or helo) at the airbase associated with the warehouse.
-- @param #RAT2 self
-- @param #RATAC ratcraft Ratcraft to spawn.