From 0fa4be7c4a9311d732ba33008e07447607499af3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 10 Jan 2023 12:44:40 +0100 Subject: [PATCH] #AWACS * Fixed initial screen text on bogey dope just being x group(s) #PLAYERTASK * Improved logic to declare task succes even if not player is assigned --- Moose Development/Moose/Ops/Awacs.lua | 3 ++- Moose Development/Moose/Ops/PlayerTask.lua | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index 9bcb9fbcd..189bd57ca 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -499,7 +499,7 @@ do -- @field #AWACS AWACS = { ClassName = "AWACS", -- #string - version = "0.2.52", -- #string + version = "0.2.53", -- #string lid = "", -- #string coalition = coalition.side.BLUE, -- #number coalitiontxt = "blue", -- #string @@ -2901,6 +2901,7 @@ function AWACS:_BogeyDope(Group) if contactsAO > 0 then local dope = self.gettext:GetEntry("DOPE",self.locale) text = string.format(dope,self:_GetCallSign(Group,GID) or "Ghost 1", self.callsigntxt) + textScreen = string.format(dope,self:_GetCallSign(Group,GID) or "Ghost 1", self.callsigntxt) local onetxt = self.gettext:GetEntry("ONE",self.locale) local grptxt = self.gettext:GetEntry("GROUP",self.locale) local groupstxt = self.gettext:GetEntry("GROUPMULTI",self.locale) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 08b1e2d38..f63d051ee 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -96,7 +96,7 @@ PLAYERTASK = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASK.version="0.1.11" +PLAYERTASK.version="0.1.12" --- Generic task condition. -- @type PLAYERTASK.Condition @@ -661,6 +661,8 @@ function PLAYERTASK:onafterStatus(From, Event, To) local status = self:GetState() + if status == "Stopped" then return self end + -- Check Target status local targetdead = false @@ -672,10 +674,11 @@ function PLAYERTASK:onafterStatus(From, Event, To) return self end end + + local clientsalive = false if status == "Executing" then -- Check Clients alive - local clientsalive = false local ClientTable = self.Clients:GetDataTable() for _,_client in pairs(ClientTable) do local client = _client -- Wrapper.Client#CLIENT @@ -689,7 +692,10 @@ function PLAYERTASK:onafterStatus(From, Event, To) self:__Failed(-2) status = "Failed" end - + end + + -- Continue if we are not done + if status ~= "Done" and status ~= "Stopped" then -- Any success condition true? local successCondition=self:_EvalConditionsAny(self.conditionSuccess) @@ -707,12 +713,9 @@ function PLAYERTASK:onafterStatus(From, Event, To) if self.verbose then self:I(self.lid.."Target dead: "..tostring(targetdead).." | Clients alive: " .. tostring(clientsalive)) end - end - -- Continue if we are not done - if status ~= "Done" then self:__Status(-20) - else + elseif status ~= "Stopped" then self:__Stop(-1) end