mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -4900,6 +4900,28 @@ function OPSGROUP:RemoveMission(Mission)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Cancel all missions in mission queue that are not already done or cancelled.
|
||||
-- @param #OPSGROUP self
|
||||
function OPSGROUP:CancelAllMissions()
|
||||
self:T(self.lid.."Cancelling ALL missions!")
|
||||
|
||||
-- Cancel all missions.
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
||||
|
||||
-- Current group status.
|
||||
local mystatus=mission:GetGroupStatus(self)
|
||||
|
||||
-- Check if mission is already over!
|
||||
if not (mystatus==AUFTRAG.GroupStatus.DONE or mystatus==AUFTRAG.GroupStatus.CANCELLED) then
|
||||
--if mission:IsNotOver() then
|
||||
self:T(self.lid.."Cancelling mission "..tostring(mission:GetName()))
|
||||
self:MissionCancel(mission)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Count remaining missons.
|
||||
-- @param #OPSGROUP self
|
||||
-- @return #number Number of missions to be done.
|
||||
@@ -5085,6 +5107,24 @@ function OPSGROUP:IsMissionInQueue(Mission)
|
||||
return false
|
||||
end
|
||||
|
||||
--- Check if a given mission type is already in the queue.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string MissionType MissionType Type of mission.
|
||||
-- @return #boolean If `true`, the mission type is in the queue.
|
||||
function OPSGROUP:IsMissionTypeInQueue(MissionType)
|
||||
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
||||
|
||||
if mission:GetType()==MissionType then
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--- Get mission by its task id.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #number taskid The id of the (waypoint) task of the mission.
|
||||
@@ -7538,21 +7578,6 @@ 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
|
||||
if mission:IsNotOver() then
|
||||
self:T(self.lid.."Cancelling mission "..tostring(mission:GetName()))
|
||||
self:MissionCancel(mission)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- On after "Dead" event.
|
||||
-- @param #OPSGROUP self
|
||||
-- @param #string From From state.
|
||||
@@ -10173,8 +10198,10 @@ function OPSGROUP:_CheckGroupDone(delay)
|
||||
|
||||
self:T(self.lid..string.format("Passed final WP, adinfinitum=FALSE, LEGION set ==> RTZ"))
|
||||
if self.isArmygroup then
|
||||
self:T2(self.lid.."RTZ to legion spawn zone")
|
||||
self:RTZ(self.legion.spawnzone)
|
||||
elseif self.isNavygroup then
|
||||
self:T2(self.lid.."RTZ to legion port zone")
|
||||
self:RTZ(self.legion.portzone)
|
||||
end
|
||||
|
||||
@@ -10257,6 +10284,7 @@ function OPSGROUP:_CheckStuck()
|
||||
if self:IsEngaging() then
|
||||
self:__Disengage(1)
|
||||
elseif self:IsReturning() then
|
||||
self:T2(self.lid.."RTZ because of stuck")
|
||||
self:__RTZ(1)
|
||||
else
|
||||
self:__Cruise(1)
|
||||
@@ -10276,6 +10304,7 @@ function OPSGROUP:_CheckStuck()
|
||||
else
|
||||
-- Give cruise command again.
|
||||
if self:IsReturning() then
|
||||
self:T2(self.lid.."RTZ because of stuck")
|
||||
self:__RTZ(1)
|
||||
else
|
||||
self:__Cruise(1)
|
||||
|
||||
Reference in New Issue
Block a user