mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Still need to fix that index issue.
This commit is contained in:
parent
3b520ab0c4
commit
87a44f7f7f
@ -3983,7 +3983,9 @@ do -- AI_A2G_DISPATCHER
|
|||||||
self:ClearDefenderTask( DefenderGroup )
|
self:ClearDefenderTask( DefenderGroup )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
-- TODO: prio 1, what is this index stuff again, simplify it.
|
||||||
if DefenderTask.Target then
|
if DefenderTask.Target then
|
||||||
|
self:F( { Target = DefenderTask.Target } )
|
||||||
local AttackerItem = Detection:GetDetectedItemByIndex( DefenderTask.Target.Index )
|
local AttackerItem = Detection:GetDetectedItemByIndex( DefenderTask.Target.Index )
|
||||||
if not AttackerItem then
|
if not AttackerItem then
|
||||||
self:F( { "Removing obsolete Target:", DefenderTask.Target.Index } )
|
self:F( { "Removing obsolete Target:", DefenderTask.Target.Index } )
|
||||||
|
|||||||
@ -1627,7 +1627,9 @@ do -- DETECTION_BASE
|
|||||||
-- @return #DETECTION_BASE.DetectedItem
|
-- @return #DETECTION_BASE.DetectedItem
|
||||||
function DETECTION_BASE:GetDetectedItemByIndex( Index )
|
function DETECTION_BASE:GetDetectedItemByIndex( Index )
|
||||||
|
|
||||||
self:F( { DetectedItemsByIndex = self.DetectedItemsByIndex } )
|
self:I( { DetectedItemsByIndex = self.DetectedItemsByIndex } )
|
||||||
|
|
||||||
|
self:I( { self.DetectedItemsByIndex } )
|
||||||
|
|
||||||
local DetectedItem = self.DetectedItemsByIndex[Index]
|
local DetectedItem = self.DetectedItemsByIndex[Index]
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
|
|||||||
@ -127,24 +127,24 @@ do -- DETECTION_ZONES
|
|||||||
function DETECTION_ZONES:CalculateIntercept( DetectedItem )
|
function DETECTION_ZONES:CalculateIntercept( DetectedItem )
|
||||||
|
|
||||||
local DetectedCoord = DetectedItem.Coordinate
|
local DetectedCoord = DetectedItem.Coordinate
|
||||||
local DetectedSpeed = DetectedCoord:GetVelocity()
|
-- local DetectedSpeed = DetectedCoord:GetVelocity()
|
||||||
local DetectedHeading = DetectedCoord:GetHeading()
|
-- local DetectedHeading = DetectedCoord:GetHeading()
|
||||||
|
--
|
||||||
if self.Intercept then
|
-- if self.Intercept then
|
||||||
local DetectedSet = DetectedItem.Set
|
-- local DetectedSet = DetectedItem.Set
|
||||||
-- todo: speed
|
-- -- todo: speed
|
||||||
|
--
|
||||||
local TranslateDistance = DetectedSpeed * self.InterceptDelay
|
-- local TranslateDistance = DetectedSpeed * self.InterceptDelay
|
||||||
|
--
|
||||||
local InterceptCoord = DetectedCoord:Translate( TranslateDistance, DetectedHeading )
|
-- local InterceptCoord = DetectedCoord:Translate( TranslateDistance, DetectedHeading )
|
||||||
|
--
|
||||||
DetectedItem.InterceptCoord = InterceptCoord
|
-- DetectedItem.InterceptCoord = InterceptCoord
|
||||||
else
|
-- else
|
||||||
|
-- DetectedItem.InterceptCoord = DetectedCoord
|
||||||
|
-- end
|
||||||
DetectedItem.InterceptCoord = DetectedCoord
|
DetectedItem.InterceptCoord = DetectedCoord
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Smoke the detected units
|
--- Smoke the detected units
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user