Update RAT.lua

This commit is contained in:
Frank 2024-03-26 22:26:58 +01:00
parent 2205100942
commit 82f4c9d526

View File

@ -2348,6 +2348,9 @@ function RAT:_Respawn(index, lastpos, delay)
env.info(string.format("element %s not SPOT", element.name)) env.info(string.format("element %s not SPOT", element.name))
end end
end end
flightgroup:Despawn(0, true)
flightgroup:Stop()
local _departure=nil local _departure=nil
local _destination=nil local _destination=nil
@ -4121,12 +4124,16 @@ function RAT:_OnEngineShutdown(EventData)
local idx=self:GetSpawnIndexFromGroup(SpawnGroup) local idx=self:GetSpawnIndexFromGroup(SpawnGroup)
local coord=SpawnGroup:GetCoordinate() local coord=SpawnGroup:GetCoordinate()
self:_Respawn(idx, coord, 3) self:_Respawn(idx, coord, 3)
else
-- Despawn group.
text="Event: Group "..SpawnGroup:GetName().." will be destroyed now."
self:T(RAT.id..text)
self:_Despawn(SpawnGroup)
end end
-- Despawn group.
text="Event: Group "..SpawnGroup:GetName().." will be destroyed now."
self:T(RAT.id..text)
self:_Despawn(SpawnGroup)
end end