mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 22:17:13 +00:00
Merge remote-tracking branch 'origin/master-ng' into develop
# Conflicts: # Moose Development/Moose/Core/Spawn.lua
This commit is contained in:
@@ -2430,12 +2430,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
|||||||
-- When spawned in the air, we need to generate a Takeoff Event.
|
-- When spawned in the air, we need to generate a Takeoff Event.
|
||||||
if Takeoff == GROUP.Takeoff.Air then
|
if Takeoff == GROUP.Takeoff.Air then
|
||||||
for UnitID, UnitSpawned in pairs( GroupSpawned:GetUnits() ) do
|
for UnitID, UnitSpawned in pairs( GroupSpawned:GetUnits() ) do
|
||||||
-- BASE:ScheduleOnce forwards its trailing args to the scheduled function as
|
--SCHEDULER:New( nil, BASE.CreateEventTakeoff, { GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject() }, 5 ) --No need to create a new SCHEDULER instance every time!
|
||||||
-- varargs, so they must NOT be wrapped in a table here (unlike SCHEDULER:New,
|
|
||||||
-- which takes a single argument table). Passing a table made it argument #1,
|
|
||||||
-- i.e. CreateEventTakeoff ran with that table as `self`, so the takeoff event
|
|
||||||
-- never fired and air-spawned groups (e.g. AI_A2A_DISPATCHER GCI defenders)
|
|
||||||
-- never activated.
|
|
||||||
self:ScheduleOnce(5, BASE.CreateEventTakeoff, GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject())
|
self:ScheduleOnce(5, BASE.CreateEventTakeoff, GroupSpawned, timer.getTime(), UnitSpawned:GetDCSObject())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user