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:
commit
69c20e78fb
@ -480,7 +480,8 @@ function ZONE_BASE:UndrawZone(Delay)
|
||||
if Delay and Delay>0 then
|
||||
self:ScheduleOnce(Delay, ZONE_BASE.UndrawZone, self)
|
||||
else
|
||||
if self.DrawID and type(self.DrawID) ~= "table" then
|
||||
if self.DrawID then
|
||||
if type(self.DrawID) ~= "table" then
|
||||
UTILS.RemoveMark(self.DrawID)
|
||||
else -- DrawID is a table with a collections of mark ids, as used in ZONE_POLYGON
|
||||
for _, mark_id in pairs(self.DrawID) do
|
||||
@ -488,6 +489,7 @@ function ZONE_BASE:UndrawZone(Delay)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
@ -2378,13 +2380,13 @@ function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
|
||||
self._.Polygon[i].y = PointsArray[i].y
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- triangulate the polygon so we can work with it
|
||||
self._Triangles = self:_Triangulate()
|
||||
-- set the polygon's surface area
|
||||
self.SurfaceArea = self:_CalculateSurfaceArea()
|
||||
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -2863,9 +2863,12 @@ function FLIGHTGROUP:_CheckGroupDone(delay, waittime)
|
||||
end
|
||||
|
||||
else
|
||||
-- Check if not parking (could be on ALERT5 and just spawned (current mission=nil)
|
||||
if not self:IsParking() then
|
||||
self:T(self.lid..string.format("Passed Final WP but Tasks=%d or Missions=%d left in the queue. Wait!", nTasks, nMissions))
|
||||
self:__Wait(-1)
|
||||
end
|
||||
end
|
||||
else
|
||||
self:T(self.lid..string.format("Passed Final WP but still have current Task (#%s) or Mission (#%s) left to do", tostring(self.taskcurrent), tostring(self.currentmission)))
|
||||
end
|
||||
|
||||
@ -3472,10 +3472,9 @@ function OPSGROUP:RemoveWaypoint(wpindex)
|
||||
|
||||
-- Could be that the waypoint we are currently moving to was the LAST waypoint. Then we now passed the final waypoint.
|
||||
if (self.adinfinitum or istemp) then
|
||||
self:_PassedFinalWaypoint(false, "Removed PASSED temporary waypoint ")
|
||||
self:_PassedFinalWaypoint(false, "Removed PASSED temporary waypoint")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@ -5801,6 +5800,27 @@ function OPSGROUP:onafterMissionDone(From, Event, To, Mission)
|
||||
end
|
||||
end
|
||||
|
||||
if self.legion and self.legionReturn==false and self.waypoints and #self.waypoints==1 then
|
||||
---
|
||||
-- This is the case where a group was send on a mission (which is over now), has no addional
|
||||
-- waypoints or tasks and should NOT return to its legion.
|
||||
-- We create a new waypoint at the current position and let it hold here.
|
||||
---
|
||||
|
||||
local Coordinate=self:GetCoordinate()
|
||||
|
||||
if self.isArmygroup then
|
||||
ARMYGROUP.AddWaypoint(self, Coordinate, 0, nil, nil, false)
|
||||
elseif self.isNavygroup then
|
||||
NAVYGROUP.AddWaypoint(self,Coordinate, 0, nil, nil, false)
|
||||
end
|
||||
|
||||
-- Remove original waypoint.
|
||||
self:RemoveWaypoint(1)
|
||||
|
||||
self:_PassedFinalWaypoint(true, "Passed final waypoint as group is done with mission but should NOT return to its legion")
|
||||
end
|
||||
|
||||
-- Check if group is done.
|
||||
self:_CheckGroupDone(delay)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user