mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
AUFTRAG and WAREHOUSE
- Added check for AUFTRAG that if it is executing and all groups are dead, it's done - Added check in WAREHOUSE find parking that units need to be alive
This commit is contained in:
@@ -3227,6 +3227,26 @@ function AUFTRAG:onafterStatus(From, Event, To)
|
||||
-- Cancel mission if mission targets are gone (if there were any in the beginning).
|
||||
-- TODO: I commented this out for some reason but I forgot why...
|
||||
self:Cancel()
|
||||
|
||||
elseif self:IsExecuting() then
|
||||
|
||||
-- Had the case that mission was in state Executing but all assigned groups were dead.
|
||||
-- TODO: might need to loop over all assigned groups
|
||||
if Ngroups==0 then
|
||||
self:Done()
|
||||
else
|
||||
local done=true
|
||||
for groupname,data in pairs(self.groupdata or {}) do
|
||||
local groupdata=data --#AUFTRAG.GroupData
|
||||
local opsgroup=groupdata.opsgroup
|
||||
if opsgroup:IsAlive() then
|
||||
done=false
|
||||
end
|
||||
end
|
||||
if done then
|
||||
self:Done()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user