Removed the escorts to detect targets using DLINK. Now escorts will only report targets that were detected by its own onboard detection methods.

This commit is contained in:
FlightControl 2019-08-07 16:42:08 +02:00
commit 5594cd8fdf

View File

@ -349,6 +349,15 @@ function AI_ESCORT:onafterStart( EscortGroupSet )
self.Detection = DETECTION_AREAS:New( EscortGroupSet, 5000 ) 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.Detection:__Start( 30 )
self.MainMenu = MENU_GROUP:New( self.PlayerGroup, self.EscortName ) self.MainMenu = MENU_GROUP:New( self.PlayerGroup, self.EscortName )
@ -364,6 +373,17 @@ function AI_ESCORT:onafterStart( EscortGroupSet )
self:_InitEscortRoute( EscortGroup ) self:_InitEscortRoute( EscortGroup )
self:SetFlightModeFormation( 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 end
) )