Abort logic improvements

This commit is contained in:
FlightControl 2017-05-05 12:40:16 +02:00
parent 0b87b265c7
commit 6f9bfc4211
2 changed files with 5 additions and 8 deletions

View File

@ -289,20 +289,17 @@ end
-- If the Unit is part of a Task in the Mission, true is returned.
-- @param #MISSION self
-- @param Wrapper.Unit#UNIT PlayerUnit The CLIENT or UNIT of the Player joining the Mission.
-- @return #boolean true if Unit is part of a Task in the Mission.
-- @return #MISSION
function MISSION:AbortUnit( PlayerUnit )
self:F( { PlayerUnit = PlayerUnit } )
local PlayerUnitRemoved = false
for TaskID, Task in pairs( self:GetTasks() ) do
local Task = Task -- Tasking.Task#TASK
if Task:AbortUnit( PlayerUnit ) then
PlayerUnitRemoved = true
end
local PlayerGroup = PlayerUnit:GetGroup()
Task:AbortGroup( PlayerGroup )
end
return PlayerUnitRemoved
return self
end
--- Handles a crash of a PlayerUnit from the Mission.

View File

@ -754,7 +754,7 @@ function TASK:RefreshMenus( TaskGroup, MenuTime )
local MissionMenu = Mission:GetMenu( TaskGroup )
local TaskText = self:GetName()
local PlannedMenu = MissionMenu:GetMenu( string.format( "Planned Tasks", TaskText ) )
local PlannedMenu = MissionMenu:GetMenu( "Planned Tasks" )
local AssignedMenu = MissionMenu:GetMenu( string.format( "Assigned Task %s", TaskText ) )
if PlannedMenu then