From f73dc6c3be6e77b6fc5497e531dd9adbe3905836 Mon Sep 17 00:00:00 2001 From: smiki Date: Tue, 16 Sep 2025 15:14:28 +0200 Subject: [PATCH 1/3] [Added] `PLAYERTASKCONTROLLER:CanJoinTask` Override function in order to implement custom logic if a player can join a task or not. --- Moose Development/Moose/Ops/PlayerTask.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 7ce6d57c2..77516f752 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -3530,6 +3530,16 @@ function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent,TaskFilter) return self 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 -- @param #PLAYERTASKCONTROLLER self -- @param Ops.PlayerTask#PLAYERTASK Task @@ -3540,6 +3550,11 @@ end function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client) self:T({Force, Group, Client}) self:T(self.lid.."_JoinTask") + + if not self:CanJoinTask(Task, Group, Client) then + return self + end + local force = false if type(Force) == "boolean" then force = Force From 04fcb985fe27bb9f5a065f7588aef8b5b9671e99 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 17 Sep 2025 12:04:34 +0200 Subject: [PATCH 2/3] #PLAYERTASK - Ensure call task failed on the controller --- Moose Development/Moose/Ops/PlayerTask.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 7ce6d57c2..95a98fcfd 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -98,7 +98,7 @@ PLAYERTASK = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASK.version="0.1.27" +PLAYERTASK.version="0.1.28" --- Generic task condition. -- @type PLAYERTASK.Condition @@ -1227,7 +1227,10 @@ function PLAYERTASK:onafterFailed(From, Event, To) self.TargetMarker:Remove() end self.FinalState = "Failed" - self:__Done(-1) + if self.TaskController then + self.TaskController:__TaskFailed(-1,self) + end + self:__Done(-1.5) end if self.TaskController.Scoring then local clients,count = self:GetClientObjects() From b320ba597a09bc40062f48c3c7dc11f5c6bede3b Mon Sep 17 00:00:00 2001 From: m1nd Date: Thu, 18 Sep 2025 00:32:48 +0200 Subject: [PATCH 3/3] fix: Add conditional checks for AWACS markers based on `AllowMarkers` property --- Moose Development/Moose/Ops/Awacs.lua | 64 ++++++++++++++++++++------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index c4d4632fa..a2dff4db3 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -2021,7 +2021,9 @@ function AWACS:SetAdditionalZone(Zone, Draw) self.BorderZone = Zone if self.debug then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) - MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition) + end elseif Draw then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) end @@ -2041,7 +2043,9 @@ function AWACS:SetRejectionZone(Zone,Draw) --MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll() elseif self.debug then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) - MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition) + end end return self end @@ -4094,10 +4098,14 @@ function AWACS:_CreateAnchorStackFromMarker(Name,Coord) if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) @@ -4140,10 +4148,14 @@ function AWACS:_CreateAnchorStack() --self.AnchorStacks:Flush() AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) else @@ -4167,10 +4179,14 @@ function AWACS:_CreateAnchorStack() if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) end @@ -5102,10 +5118,14 @@ function AWACS:AddCAPAirWing(AirWing,Zone) if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) AirWing.HasOwnStation = true @@ -5948,23 +5968,35 @@ function AWACS:onafterStart(From, Event, To) self.OpsZone:DrawZone(self.coalition,{1,0,0},1,{1,0,0},0.2,5,true) local AOCoordString = self.AOCoordinate:ToStringLLDDM() local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) - MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + end self.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) if not self.GCI then - MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end self.OrbitZone:DrawZone(self.coalition,{0,1,0},1,{0,1,0},0.2,5,true) - MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + end end else local AOCoordString = self.AOCoordinate:ToStringLLDDM() local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) - MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + end if not self.GCI then - MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + end end local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) - MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end if not self.GCI then