Update OpsGroup.lua

- Fixed group returning to legion when told not to
This commit is contained in:
Frank 2023-12-04 22:19:31 +01:00
parent 4d4b8862c2
commit bc3a5271dc

View File

@ -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. -- 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 if (self.adinfinitum or istemp) then
self:_PassedFinalWaypoint(false, "Removed PASSED temporary waypoint ") self:_PassedFinalWaypoint(false, "Removed PASSED temporary waypoint")
end end
end end
end end
@ -5801,6 +5800,27 @@ function OPSGROUP:onafterMissionDone(From, Event, To, Mission)
end end
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. -- Check if group is done.
self:_CheckGroupDone(delay) self:_CheckGroupDone(delay)