From 4fb2ad88bc51d4808d5dd2c222320cea1a4d3136 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 13 Dec 2024 12:07:31 +0100 Subject: [PATCH] #OpsGroup - fix holding condition for FG at holding coordinate --- Moose Development/Moose/Ops/FlightGroup.lua | 19 +++++++++++++++++++ Moose Development/Moose/Ops/OpsGroup.lua | 1 + Moose Development/Moose/Utilities/Utils.lua | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index c265e11d2..1d77397e0 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -1277,6 +1277,25 @@ function FLIGHTGROUP:Status() end end + --- check if we need to end holding + --self:T(self.lid.."Checking if we are holding at a holding point...") + if mission and mission.missionHoldingCoord and self.isHoldingAtHoldingPoint == true then + self:T(self.lid.."...yes") + if mission:IsReadyToPush() then + --self:T(self.lid.."Ready to push -> YES") + -- move flag to 1 + self.flaghold:Set(1) + -- Not waiting any more. + self.Twaiting=nil + self.dTwait=nil + self.isHoldingAtHoldingPoint = false + --else + --self:T(self.lid.."Ready to push -> NO!") + end + --else + --self:T(self.lid.."...no") + end + -- If mission, check if DCS task needs to be updated. if mission and mission.updateDCSTask then diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 6b6425306..ec4bf82b9 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -6136,6 +6136,7 @@ function OPSGROUP:RouteToMission(mission, delay) -- Add waypoint task. UpdateRoute is called inside. local waypointtask=self:AddTaskWaypoint(DCSTasks, waypoint, "Holding") waypointtask.ismission=false + self.isHoldingAtHoldingPoint = true end if ingresscoord then diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index fbcb6ba60..343609c9e 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -2528,7 +2528,7 @@ end --- Function to save an object to a file -- @param #string Path The path to use. Use double backslashes \\\\ on Windows filesystems. -- @param #string Filename The name of the file. Existing file will be overwritten. --- @param #table Data The LUA data structure to save. This will be e.g. a table of text lines with an \\n at the end of each line. +-- @param #string Data The data structure to save. This will be e.g. a string of text lines with an \\n at the end of each line. -- @return #boolean outcome True if saving is possible, else false. function UTILS.SaveToFile(Path,Filename,Data) -- Thanks to @FunkyFranky