Fixed with A2G tasking

Imagine, the mission had a static moose.lua. I was testing with a static
moose.lua
This commit is contained in:
FlightControl
2017-05-16 21:24:38 +02:00
parent 1662b891df
commit caedaddd06
4 changed files with 47 additions and 35 deletions

View File

@@ -227,21 +227,6 @@ function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefi
return self
end
-- FSM function for a MISSION
-- @param #MISSION self
-- @param #string From
-- @param #string Event
-- @param #string To
function MISSION:onbeforeComplete( From, Event, To )
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK
if not Task:IsStateSuccess() and not Task:IsStateFAILED() and not Task:IsStateAborted() and not Task:IsStateCancelled() then
return false -- Mission cannot be completed. Other Tasks are still active.
end
end
return true -- Allow Mission completion.
end
-- FSM function for a MISSION
-- @param #MISSION self
@@ -250,7 +235,7 @@ end
-- @param #string To
function MISSION:onenterCOMPLETED( From, Event, To )
self:GetCommandCenter():MessageToCoalition( "Mission " .. self:GetName() .. " has been completed! Good job guys!" )
self:GetCommandCenter():MessageToCoalition( self:GetName() .. " has been completed! Good job guys!" )
end
--- Gets the mission name.