Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Applevangelist 2023-12-06 08:44:15 +01:00
commit 69c20e78fb
3 changed files with 38 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -3475,7 +3475,6 @@ function OPSGROUP:RemoveWaypoint(wpindex)
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)