mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPS Operation
This commit is contained in:
@@ -4474,7 +4474,7 @@ function AUFTRAG:onafterCancel(From, Event, To)
|
|||||||
else
|
else
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T(self.lid..string.format("No legion, commander or chief. Attached flights will cancel the mission on their own. Will wait for mission DONE before evaluation!"))
|
self:T(self.lid..string.format("No legion, commander or chief. Attached groups will cancel the mission on their own. Will wait for mission DONE before evaluation!"))
|
||||||
|
|
||||||
-- Loop over all groups.
|
-- Loop over all groups.
|
||||||
for _,_groupdata in pairs(self.groupdata or {}) do
|
for _,_groupdata in pairs(self.groupdata or {}) do
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4711,9 +4711,13 @@ end
|
|||||||
-- @return #OPSGROUP self
|
-- @return #OPSGROUP self
|
||||||
function OPSGROUP:RemoveMission(Mission)
|
function OPSGROUP:RemoveMission(Mission)
|
||||||
|
|
||||||
for i,_mission in pairs(self.missionqueue) do
|
--for i,_mission in pairs(self.missionqueue) do
|
||||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
for i=#self.missionqueue,1,-1 do
|
||||||
|
|
||||||
|
-- Mission.
|
||||||
|
local mission=self.missionqueue[i] --Ops.Auftrag#AUFTRAG
|
||||||
|
|
||||||
|
-- Check mission ID.
|
||||||
if mission.auftragsnummer==Mission.auftragsnummer then
|
if mission.auftragsnummer==Mission.auftragsnummer then
|
||||||
|
|
||||||
-- Remove mission waypoint task.
|
-- Remove mission waypoint task.
|
||||||
@@ -4724,9 +4728,10 @@ function OPSGROUP:RemoveMission(Mission)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Take care of a paused mission.
|
-- Take care of a paused mission.
|
||||||
for j,mid in pairs(self.pausedmissions) do
|
for j=#self.pausedmissions,1,-1 do
|
||||||
|
local mid=self.pausedmissions[j]
|
||||||
if Mission.auftragsnummer==mid then
|
if Mission.auftragsnummer==mid then
|
||||||
table.remove(self.pausedmission, j)
|
table.remove(self.pausedmissions, j)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -5161,6 +5166,7 @@ function OPSGROUP:onafterMissionCancel(From, Event, To, Mission)
|
|||||||
---
|
---
|
||||||
|
|
||||||
-- Some missions dont have a task set, which could be cancelled.
|
-- Some missions dont have a task set, which could be cancelled.
|
||||||
|
--[[
|
||||||
if Mission.type==AUFTRAG.Type.ALERT5 or
|
if Mission.type==AUFTRAG.Type.ALERT5 or
|
||||||
Mission.type==AUFTRAG.Type.ONGUARD or
|
Mission.type==AUFTRAG.Type.ONGUARD or
|
||||||
Mission.type==AUFTRAG.Type.ARMOREDGUARD or
|
Mission.type==AUFTRAG.Type.ARMOREDGUARD or
|
||||||
@@ -5173,19 +5179,31 @@ function OPSGROUP:onafterMissionCancel(From, Event, To, Mission)
|
|||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
|
|
||||||
-- Get mission waypoint task.
|
-- Get mission waypoint task.
|
||||||
local Task=Mission:GetGroupWaypointTask(self)
|
local Task=Mission:GetGroupWaypointTask(self)
|
||||||
|
|
||||||
-- Debug info.
|
if Task then
|
||||||
self:T(self.lid..string.format("Cancel current mission %s. Task=%s", tostring(Mission.name), tostring(Task and Task.description or "WTF")))
|
|
||||||
|
|
||||||
-- Cancelling the mission is actually cancelling the current task.
|
-- Debug info.
|
||||||
-- Note that two things can happen.
|
self:T(self.lid..string.format("Cancel current mission %s. Task=%s", tostring(Mission.name), tostring(Task and Task.description or "WTF")))
|
||||||
-- 1.) Group is still on the way to the waypoint (status should be STARTED). In this case there would not be a current task!
|
|
||||||
-- 2.) Group already passed the mission waypoint (status should be EXECUTING).
|
|
||||||
|
|
||||||
self:TaskCancel(Task)
|
-- Cancelling the mission is actually cancelling the current task.
|
||||||
|
-- Note that two things can happen.
|
||||||
|
-- 1.) Group is still on the way to the waypoint (status should be STARTED). In this case there would not be a current task!
|
||||||
|
-- 2.) Group already passed the mission waypoint (status should be EXECUTING).
|
||||||
|
|
||||||
|
self:TaskCancel(Task)
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
-- Some missions dont have a task set, which could be cancelled.
|
||||||
|
|
||||||
|
-- Trigger mission don task.
|
||||||
|
self:MissionDone(Mission)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user