a2a-dispatcher: add check for not in air in OnEventEngineShutdown

This fixes the problem of planes owned by gcicap would immediately
despawn when shot causing their engine to quit.

While not ultimately satisfying as planes shot while taxiing will still
immediately despawn. One is now able to see their air victories in all
their glory, including the fiery crash into the ground.

Bug: 932
Signed-off-by: Jonathan Toppins <jtoppins@users.sourceforge.net>
This commit is contained in:
Jonathan Toppins 2018-06-28 00:17:26 -04:00
parent 3ed9555705
commit 169dcfe3f6

View File

@ -1049,7 +1049,8 @@ do -- AI_A2A_DISPATCHER
if Squadron then
self:F( { SquadronName = Squadron.Name } )
local LandingMethod = self:GetSquadronLanding( Squadron.Name )
if LandingMethod == AI_A2A_DISPATCHER.Landing.AtEngineShutdown then
if LandingMethod == AI_A2A_DISPATCHER.Landing.AtEngineShutdown and
not DefenderUnit:InAir() then
local DefenderSize = Defender:GetSize()
if DefenderSize == 1 then
self:RemoveDefenderFromSquadron( Squadron, Defender )