This commit is contained in:
Applevangelist 2025-10-07 17:48:22 +02:00
parent 75c350cffc
commit 53b1415e87
2 changed files with 27 additions and 1 deletions

View File

@ -4016,6 +4016,23 @@ function AUFTRAG:IsOver()
return over return over
end end
--- Check if mission is repeatable.
-- @param #AUFTRAG self
-- @return #boolean If true, mission is repeatable.
function AUFTRAG:IsRepeatable()
local repeatmeS=self.repeatedSuccess<self.NrepeatSuccess or self.repeated<self.Nrepeat
local repeatmeF=self.repeatedFailure<self.NrepeatFailure or self.repeated<self.Nrepeat
if repeatmeS==true or repeatmeF==true then return true else return false end
return false
end
--- Check if mission is NOT repeatable.
-- @param #AUFTRAG self
-- @return #boolean If true, mission is NOT repeatable.
function AUFTRAG:IsNotRepeatable()
return not self:IsRepeatable()
end
--- Check if mission is NOT over. --- Check if mission is NOT over.
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @return #boolean If true, mission is NOT over yet. -- @return #boolean If true, mission is NOT over yet.

View File

@ -662,6 +662,15 @@ function LEGION:CheckMissionQueue()
if mission:IsNotOver() and mission:IsReadyToCancel() then if mission:IsNotOver() and mission:IsReadyToCancel() then
mission:Cancel() mission:Cancel()
end end
-- Housekeeping
local TNow = timer.getTime()
if mission:IsOver() and mission:IsNotRepeatable() and mission.DeletionTimstamp == nil then
mission.DeletionTimstamp = TNow
end
if mission.DeletionTimstamp ~= nil and TNow - mission.DeletionTimstamp > 1800 then
mission = nil
end
end end
-- Check that runway is operational and that carrier is not recovering. -- Check that runway is operational and that carrier is not recovering.
@ -761,7 +770,7 @@ function LEGION:CheckMissionQueue()
-- Reduce number of reinforcements. -- Reduce number of reinforcements.
if reinforce then if reinforce then
mission.reinforce=mission.reinforce-#assets mission.reinforce=mission.reinforce-#assets
self:I(self.lid..string.format("Reinforced with N=%d Nreinforce=%d", #assets, mission.reinforce)) self:T(self.lid..string.format("Reinforced with N=%d Nreinforce=%d", #assets, mission.reinforce))
end end
return true return true