mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
OPS
- Improved recovery of retreated groups
This commit is contained in:
parent
2d0b4d6ae5
commit
520eb4cd1d
@ -115,6 +115,7 @@ function ARMYGROUP:New(group)
|
||||
self:AddTransition("*", "Cruise", "Cruising") -- Cruise along the given route of waypoints.
|
||||
|
||||
self:AddTransition("*", "RTZ", "Returning") -- Group is returning to (home) zone.
|
||||
self:AddTransition("Holding", "Returned", "Returned") -- Group is returned to (home) zone, e.g. when unloaded from carrier.
|
||||
self:AddTransition("Returning", "Returned", "Returned") -- Group is returned to (home) zone.
|
||||
|
||||
self:AddTransition("*", "Detour", "OnDetour") -- Make a detour to a coordinate and resume route afterwards.
|
||||
@ -1351,6 +1352,9 @@ function ARMYGROUP:onafterRetreat(From, Event, To, Zone, Formation)
|
||||
|
||||
-- Set if we want to resume route after reaching the detour waypoint.
|
||||
wp.detour=0
|
||||
|
||||
-- Cancel all missions.
|
||||
self:CancelAllMissions()
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -6125,6 +6125,19 @@ function OPSGROUP:onbeforeDead(From, Event, To)
|
||||
end
|
||||
end
|
||||
|
||||
--- Cancel all missions in mission queue.
|
||||
-- @param #OPSGROUP self
|
||||
function OPSGROUP:CancelAllMissions()
|
||||
|
||||
-- Cancel all missions.
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
||||
self:T(self.lid.."Cancelling mission "..tostring(mission:GetName()))
|
||||
self:MissionCancel(mission)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- On after "Dead" event.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string From From state.
|
||||
@ -8055,6 +8068,12 @@ end
|
||||
-- @param #OPSGROUP OpsGroupCargo Cargo OPSGROUP that was unloaded from a carrier.
|
||||
function OPSGROUP:onafterUnloaded(From, Event, To, OpsGroupCargo)
|
||||
self:T(self.lid..string.format("Unloaded OPSGROUP %s", OpsGroupCargo:GetName()))
|
||||
|
||||
if OpsGroupCargo.legion and OpsGroupCargo:IsInZone(OpsGroupCargo.legion.spawnzone) then
|
||||
self:T(self.lid..string.format("Unloaded group %s returned to legion", OpsGroupCargo:GetName()))
|
||||
OpsGroupCargo:Returned()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -8592,18 +8611,24 @@ function OPSGROUP:_CheckGroupDone(delay)
|
||||
return
|
||||
end
|
||||
|
||||
-- Group is returning
|
||||
-- Group is returning.
|
||||
if self:IsReturning() then
|
||||
self:T(self.lid.."Returning! Group NOT done...")
|
||||
return
|
||||
end
|
||||
|
||||
-- Group is returning
|
||||
-- Group is rearming.
|
||||
if self:IsRearming() then
|
||||
self:T(self.lid.."Rearming! Group NOT done...")
|
||||
return
|
||||
end
|
||||
|
||||
-- Group is retreating.
|
||||
if self:IsRetreating() then
|
||||
self:T(self.lid.."Retreating! Group NOT done...")
|
||||
return
|
||||
end
|
||||
|
||||
-- Group is waiting. We deny all updates.
|
||||
if self:IsWaiting() then
|
||||
-- If group is waiting, we assume that is the way it is meant to be.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user