From 5a97f6877868a7c48fc369a30b353e767f8e8251 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 2 Aug 2019 21:10:56 +0300 Subject: [PATCH 1/2] 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 ) From fbb32a9e455a774b0792aca5b681393a85049461 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Wed, 7 Aug 2019 16:41:21 +0200 Subject: [PATCH 2/2] Removed the escorts to detect targets using DLINK. Now escorts will only report targets that were detected by its own onboard detection methods. --- Moose Development/Moose/AI/AI_Escort.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Moose Development/Moose/AI/AI_Escort.lua b/Moose Development/Moose/AI/AI_Escort.lua index 815f8dc21..254af3768 100644 --- a/Moose Development/Moose/AI/AI_Escort.lua +++ b/Moose Development/Moose/AI/AI_Escort.lua @@ -349,6 +349,15 @@ function AI_ESCORT:onafterStart( EscortGroupSet ) self.Detection = DETECTION_AREAS:New( EscortGroupSet, 5000 ) + -- This only makes the escort report detections made by the escort, not through DLINK. + -- These must be enquired using other facilities. + -- In this way, the escort will report the target areas that are relevant for the mission. + self.Detection:InitDetectVisual( true ) + self.Detection:InitDetectIRST( true ) + self.Detection:InitDetectOptical( true ) + self.Detection:InitDetectRadar( true ) + self.Detection:InitDetectRWR( true ) + self.Detection:__Start( 30 ) self.MainMenu = MENU_GROUP:New( self.PlayerGroup, self.EscortName )