mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Only remove planned tasks
This commit is contained in:
parent
89371378b7
commit
0702057f47
@ -309,7 +309,9 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
local TaskReport = REPORT:New()
|
local TaskReport = REPORT:New()
|
||||||
|
|
||||||
-- Checking the task queue for the dispatcher, and removing any obsolete task!
|
-- Checking the task queue for the dispatcher, and removing any obsolete task!
|
||||||
for TaskIndex, Task in pairs( self.Tasks ) do
|
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:GetDetectedItem( TaskIndex )
|
||||||
if not DetectedItem then
|
if not DetectedItem then
|
||||||
local TaskText = Task:GetName()
|
local TaskText = Task:GetName()
|
||||||
@ -320,6 +322,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
self.Tasks[TaskIndex] = nil
|
self.Tasks[TaskIndex] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Now that all obsolete tasks are removed, loop through the detected targets.
|
-- Now that all obsolete tasks are removed, loop through the detected targets.
|
||||||
for DetectedItemID, DetectedItem in pairs( Detection:GetDetectedItems() ) do
|
for DetectedItemID, DetectedItem in pairs( Detection:GetDetectedItems() ) do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user