mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update Spawn.lua (#1786)
Update function SPAWN:_SpawnCleanUpScheduler() to better cater for Helos
This commit is contained in:
parent
8d2660508b
commit
69b70bfed6
@ -3365,10 +3365,12 @@ end
|
|||||||
-- @return #boolean True = Continue Scheduler
|
-- @return #boolean True = Continue Scheduler
|
||||||
function SPAWN:_SpawnCleanUpScheduler()
|
function SPAWN:_SpawnCleanUpScheduler()
|
||||||
self:F( { "CleanUp Scheduler:", self.SpawnTemplatePrefix } )
|
self:F( { "CleanUp Scheduler:", self.SpawnTemplatePrefix } )
|
||||||
|
|
||||||
local SpawnGroup, SpawnCursor = self:GetFirstAliveGroup()
|
local SpawnGroup, SpawnCursor = self:GetFirstAliveGroup()
|
||||||
self:T( { "CleanUp Scheduler:", SpawnGroup, SpawnCursor } )
|
self:T( { "CleanUp Scheduler:", SpawnGroup, SpawnCursor } )
|
||||||
|
|
||||||
|
local IsHelo = SpawnGroup:IsHelicopter()
|
||||||
|
|
||||||
while SpawnGroup do
|
while SpawnGroup do
|
||||||
|
|
||||||
local SpawnUnits = SpawnGroup:GetUnits()
|
local SpawnUnits = SpawnGroup:GetUnits()
|
||||||
@ -3383,7 +3385,7 @@ function SPAWN:_SpawnCleanUpScheduler()
|
|||||||
self:T( { SpawnUnitName, Stamp } )
|
self:T( { SpawnUnitName, Stamp } )
|
||||||
|
|
||||||
if Stamp.Vec2 then
|
if Stamp.Vec2 then
|
||||||
if SpawnUnit:InAir() == false and SpawnUnit:GetVelocityKMH() < 1 then
|
if (SpawnUnit:InAir() == false and SpawnUnit:GetVelocityKMH() < 1) or IsHelo then
|
||||||
local NewVec2 = SpawnUnit:GetVec2()
|
local NewVec2 = SpawnUnit:GetVec2()
|
||||||
if (Stamp.Vec2.x == NewVec2.x and Stamp.Vec2.y == NewVec2.y) or (SpawnUnit:GetLife() <= 1) then
|
if (Stamp.Vec2.x == NewVec2.x and Stamp.Vec2.y == NewVec2.y) or (SpawnUnit:GetLife() <= 1) then
|
||||||
-- If the plane is not moving or dead , and is on the ground, assign it with a timestamp...
|
-- If the plane is not moving or dead , and is on the ground, assign it with a timestamp...
|
||||||
@ -3402,7 +3404,7 @@ function SPAWN:_SpawnCleanUpScheduler()
|
|||||||
Stamp.Time = nil
|
Stamp.Time = nil
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if SpawnUnit:InAir() == false then
|
if SpawnUnit:InAir() == false or IsHelo then
|
||||||
Stamp.Vec2 = SpawnUnit:GetVec2()
|
Stamp.Vec2 = SpawnUnit:GetVec2()
|
||||||
if (SpawnUnit:GetVelocityKMH() < 1) then
|
if (SpawnUnit:GetVelocityKMH() < 1) then
|
||||||
Stamp.Time = timer.getTime()
|
Stamp.Time = timer.getTime()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user