mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Progress
This commit is contained in:
parent
9be9277a08
commit
d672983c11
@ -2963,7 +2963,7 @@ do -- AI_A2A_DISPATCHER
|
||||
end
|
||||
else
|
||||
if DefenderTask.Target then
|
||||
local AttackerItem = Detection:GetDetectedItem( DefenderTask.Target.Index )
|
||||
local AttackerItem = Detection:GetDetectedItemByIndex( DefenderTask.Target.Index )
|
||||
if not AttackerItem then
|
||||
self:F( { "Removing obsolete Target:", DefenderTask.Target.Index } )
|
||||
self:ClearDefenderTaskTarget( AIGroup )
|
||||
|
||||
@ -938,7 +938,7 @@ do -- DESIGNATE
|
||||
|
||||
for DesignateIndex, Designating in pairs( self.Designating ) do
|
||||
|
||||
local DetectedItem = self.Detection:GetDetectedItem( DesignateIndex )
|
||||
local DetectedItem = self.Detection:GetDetectedItemByIndex( DesignateIndex )
|
||||
|
||||
if DetectedItem then
|
||||
|
||||
|
||||
@ -275,6 +275,7 @@ do -- DETECTION_BASE
|
||||
DetectionRun = 0,
|
||||
DetectedObjectsIdentified = {},
|
||||
DetectedItems = {},
|
||||
DetectedItemsByIndex = {},
|
||||
}
|
||||
|
||||
--- @type DETECTION_BASE.DetectedObjects
|
||||
@ -1470,7 +1471,7 @@ do -- DETECTION_BASE
|
||||
if DetectedItemKey then
|
||||
self.DetectedItems[DetectedItemKey] = DetectedItem
|
||||
else
|
||||
self.DetectedItemsByIndex[self.DetectedItemMax] = DetectedItem
|
||||
self.DetectedItems[self.DetectedItemMax] = DetectedItem
|
||||
end
|
||||
|
||||
self.DetectedItemsByIndex[self.DetectedItemMax] = DetectedItem
|
||||
|
||||
@ -507,7 +507,7 @@ do -- TASK_A2A_DISPATCHER
|
||||
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
||||
local Task = TaskData -- Tasking.Task#TASK
|
||||
if Task:IsStatePlanned() then
|
||||
local DetectedItem = Detection:GetDetectedItem( TaskIndex )
|
||||
local DetectedItem = Detection:GetDetectedItemByIndex( TaskIndex )
|
||||
if not DetectedItem then
|
||||
local TaskText = Task:GetName()
|
||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||
|
||||
@ -310,13 +310,13 @@ do -- TASK_A2G
|
||||
function TASK_A2G:UpdateTaskInfo( DetectedItem )
|
||||
|
||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||
local TargetCoordinate = DetectedItem and self.Detection:GetDetectedItemCoordinate( self.DetectedItem ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
||||
local TargetCoordinate = DetectedItem and self.Detection:GetDetectedItemCoordinate( DetectedItem ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
||||
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
||||
self.TaskInfo:AddCoordinate( TargetCoordinate, 1, "SOD" )
|
||||
|
||||
local ThreatLevel, ThreatText
|
||||
if DetectedItem then
|
||||
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( self.DetectedItem )
|
||||
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( DetectedItem )
|
||||
else
|
||||
ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
||||
end
|
||||
|
||||
@ -575,7 +575,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
||||
local Task = TaskData -- Tasking.Task#TASK
|
||||
if Task:IsStatePlanned() then
|
||||
local DetectedItem = Detection:GetDetectedItem( TaskIndex )
|
||||
local DetectedItem = Detection:GetDetectedItemByIndex( TaskIndex )
|
||||
if not DetectedItem then
|
||||
local TaskText = Task:GetName()
|
||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||
@ -663,6 +663,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||
if TargetSetUnit then
|
||||
Task:SetTargetSetUnit( TargetSetUnit )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
Task:UpdateTaskInfo( DetectedItem )
|
||||
else
|
||||
Task:Cancel()
|
||||
@ -673,7 +674,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
||||
if TargetSetUnit then
|
||||
Task:SetTargetSetUnit( TargetSetUnit )
|
||||
Task:SetDetection( Detection, TaskIndex )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
Task:UpdateTaskInfo( DetectedItem )
|
||||
else
|
||||
Task:Cancel()
|
||||
@ -684,7 +685,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateBAI( DetectedItem ) -- Returns a SetUnit if there are targets to be BAIed...
|
||||
if TargetSetUnit then
|
||||
Task:SetTargetSetUnit( TargetSetUnit )
|
||||
Task:SetDetection( Detection, TaskIndex )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
Task:UpdateTaskInfo( DetectedItem )
|
||||
else
|
||||
Task:Cancel()
|
||||
@ -705,7 +706,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||
if TargetSetUnit then
|
||||
Task = TASK_A2G_SEAD:New( Mission, self.SetGroup, string.format( "SEAD.%03d", DetectedItemID ), TargetSetUnit )
|
||||
Task:SetDetection( Detection, TaskIndex )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
end
|
||||
|
||||
-- Evaluate CAS
|
||||
@ -713,7 +714,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
||||
if TargetSetUnit then
|
||||
Task = TASK_A2G_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", DetectedItemID ), TargetSetUnit )
|
||||
Task:SetDetection( Detection, TaskIndex )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
end
|
||||
|
||||
-- Evaluate BAI
|
||||
@ -721,7 +722,7 @@ do -- TASK_A2G_DISPATCHER
|
||||
local TargetSetUnit = self:EvaluateBAI( DetectedItem, self.Mission:GetCommandCenter():GetPositionable():GetCoalition() ) -- Returns a SetUnit if there are targets to be BAIed...
|
||||
if TargetSetUnit then
|
||||
Task = TASK_A2G_BAI:New( Mission, self.SetGroup, string.format( "BAI.%03d", DetectedItemID ), TargetSetUnit )
|
||||
Task:SetDetection( Detection, TaskIndex )
|
||||
Task:SetDetection( Detection, DetectedItem )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user