Merge pull request #2333 from shaji-Dev/develop

[FIXED] AUFTRAG and FSM state mismatch workaround `AUFTRAG:CheckGroupsDone`
This commit is contained in:
Thomas 2025-07-14 19:18:05 +02:00 committed by GitHub
commit 5e4f9f035b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4801,6 +4801,8 @@ end
-- @return #boolean If `true`, all groups are done with the mission.
function AUFTRAG:CheckGroupsDone()
local fsmState = self:GetState()
-- Check status of all OPS groups.
for groupname,data in pairs(self.groupdata) do
local groupdata=data --#AUFTRAG.GroupData
@ -4859,7 +4861,7 @@ function AUFTRAG:CheckGroupsDone()
return true
end
if (self:IsStarted() or self:IsExecuting()) and self:CountOpsGroups()>0 then
if (self:IsStarted() or self:IsExecuting()) and (fsmState == AUFTRAG.Status.STARTED or fsmState == AUFTRAG.Status.EXECUTING) and self:CountOpsGroups()>0 then
self:T(self.lid..string.format("CheckGroupsDone: Mission is STARTED state %s [FSM=%s] and count of alive OPSGROUP > zero. Mission NOT DONE!", self.status, self:GetState()))
return false
end