mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #2385 from shaji-Dev/develop
[Added] `PLAYERTASKCONTROLLER:CanJoinTask`
This commit is contained in:
commit
95210366e9
@ -3530,6 +3530,16 @@ function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent,TaskFilter)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Override this function in order to implement custom logic if a player can join a task or not.
|
||||||
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
|
-- @param Ops.PlayerTask#PLAYERTASK Task
|
||||||
|
-- @param Wrapper.Group#GROUP Group
|
||||||
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
|
-- @return #boolean Outcome True if player can join the task, false if not
|
||||||
|
function PLAYERTASKCONTROLLER:CanJoinTask(Task, Group, Client)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Join a player to a task
|
--- [Internal] Join a player to a task
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @param Ops.PlayerTask#PLAYERTASK Task
|
-- @param Ops.PlayerTask#PLAYERTASK Task
|
||||||
@ -3540,6 +3550,11 @@ end
|
|||||||
function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client)
|
function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client)
|
||||||
self:T({Force, Group, Client})
|
self:T({Force, Group, Client})
|
||||||
self:T(self.lid.."_JoinTask")
|
self:T(self.lid.."_JoinTask")
|
||||||
|
|
||||||
|
if not self:CanJoinTask(Task, Group, Client) then
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
local force = false
|
local force = false
|
||||||
if type(Force) == "boolean" then
|
if type(Force) == "boolean" then
|
||||||
force = Force
|
force = Force
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user