mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
First prototype of the scheduler dispatcher is ready... It works, but the code was very difficult...
So, when the Scheduler that is passed to the AddScheduler is nillified, the internal arrays that keep the Scheduler reference are also nillified. And it does what i need for further utilization in MOOSE classes. When the Scheduler is nillified, but, a schedule was planned for that Scheduler, once the scheduler fires off, it will ignore that call... cool. Sven
This commit is contained in:
@@ -148,9 +148,7 @@ function TASK_BASE:New( Mission, SetGroupAssign, TaskName, TaskType )
|
||||
self:UnAssignFromUnit( TaskUnit )
|
||||
self:MessageToGroups( TaskUnit:GetPlayerName() .. " aborted Task " .. self:GetName() )
|
||||
end
|
||||
if self:HasAliveUnits() == false then
|
||||
self:__Abort( 1 )
|
||||
end
|
||||
self:__Abort( 1 )
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -793,6 +791,27 @@ function TASK_BASE:SetBriefing( TaskBriefing )
|
||||
return self
|
||||
end
|
||||
|
||||
--- StateMachine callback function for a TASK
|
||||
-- @param #TASK_BASE self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Event#EVENTDATA Event
|
||||
function TASK_BASE:onbeforeAbort( Event, From, To )
|
||||
|
||||
self:E("Abort")
|
||||
|
||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||
if self:HasAliveUnits() then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
self:MessageToGroups( "Task " .. self:GetName() .. " has been aborted! Task will be replanned." )
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- StateMachine callback function for a TASK
|
||||
|
||||
Reference in New Issue
Block a user