From 5a97f6877868a7c48fc369a30b353e767f8e8251 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 2 Aug 2019 21:10:56 +0300 Subject: [PATCH] Escort menus are deleted once the escort crashes. --- Moose Development/Moose/AI/AI_Escort.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Moose Development/Moose/AI/AI_Escort.lua b/Moose Development/Moose/AI/AI_Escort.lua index dc9e699b4..815f8dc21 100644 --- a/Moose Development/Moose/AI/AI_Escort.lua +++ b/Moose Development/Moose/AI/AI_Escort.lua @@ -364,6 +364,17 @@ function AI_ESCORT:onafterStart( EscortGroupSet ) self:_InitEscortRoute( EscortGroup ) self:SetFlightModeFormation( EscortGroup ) + + --- @param #AI_ESCORT self + -- @param Core.Event#EVENTDATA EventData + function EscortGroup:OnEventDeadOrCrash( EventData ) + self:F( { "EventDead", EventData } ) + self.EscortMenu:Remove() + end + + EscortGroup:HandleEvent( EVENTS.Dead, EscortGroup.OnEventDeadOrCrash ) + EscortGroup:HandleEvent( EVENTS.Crash, EscortGroup.OnEventDeadOrCrash ) + end )