mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Abort logic improvements
This commit is contained in:
parent
0b87b265c7
commit
6f9bfc4211
@ -289,20 +289,17 @@ end
|
|||||||
-- If the Unit is part of a Task in the Mission, true is returned.
|
-- If the Unit is part of a Task in the Mission, true is returned.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @param Wrapper.Unit#UNIT PlayerUnit The CLIENT or UNIT of the Player joining the Mission.
|
-- @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 )
|
function MISSION:AbortUnit( PlayerUnit )
|
||||||
self:F( { PlayerUnit = PlayerUnit } )
|
self:F( { PlayerUnit = PlayerUnit } )
|
||||||
|
|
||||||
local PlayerUnitRemoved = false
|
|
||||||
|
|
||||||
for TaskID, Task in pairs( self:GetTasks() ) do
|
for TaskID, Task in pairs( self:GetTasks() ) do
|
||||||
local Task = Task -- Tasking.Task#TASK
|
local Task = Task -- Tasking.Task#TASK
|
||||||
if Task:AbortUnit( PlayerUnit ) then
|
local PlayerGroup = PlayerUnit:GetGroup()
|
||||||
PlayerUnitRemoved = true
|
Task:AbortGroup( PlayerGroup )
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return PlayerUnitRemoved
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Handles a crash of a PlayerUnit from the Mission.
|
--- Handles a crash of a PlayerUnit from the Mission.
|
||||||
|
|||||||
@ -754,7 +754,7 @@ function TASK:RefreshMenus( TaskGroup, MenuTime )
|
|||||||
local MissionMenu = Mission:GetMenu( TaskGroup )
|
local MissionMenu = Mission:GetMenu( TaskGroup )
|
||||||
|
|
||||||
local TaskText = self:GetName()
|
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 ) )
|
local AssignedMenu = MissionMenu:GetMenu( string.format( "Assigned Task %s", TaskText ) )
|
||||||
|
|
||||||
if PlannedMenu then
|
if PlannedMenu then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user