* 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
This commit is contained in:
Applevangelist 2023-01-10 12:44:40 +01:00
parent a7bad8e9f4
commit 0fa4be7c4a
2 changed files with 12 additions and 8 deletions

View File

@ -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)

View File

@ -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
@ -673,9 +675,10 @@ function PLAYERTASK:onafterStatus(From, Event, To)
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