mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update OpsGroup.lua
This commit is contained in:
@@ -6087,12 +6087,18 @@ end
|
|||||||
|
|
||||||
--- Clear waypoints.
|
--- Clear waypoints.
|
||||||
-- @param #OPSGROUP self
|
-- @param #OPSGROUP self
|
||||||
function OPSGROUP:ClearWaypoints()
|
-- @param #number IndexMin Clear waypoints up to this min WP index. Default 1.
|
||||||
|
-- @param #number IndexMax Clear waypoints up to this max WP index. Default `#self.waypoints`.
|
||||||
|
function OPSGROUP:ClearWaypoints(IndexMin, IndexMax)
|
||||||
|
|
||||||
|
IndexMin=IndexMin or 1
|
||||||
|
IndexMax=IndexMax or #self.waypoints
|
||||||
|
|
||||||
-- Clear all waypoints.
|
-- Clear all waypoints.
|
||||||
for i=1,#self.waypoints do
|
for i=IndexMax,IndexMin,-1 do
|
||||||
table.remove(self.waypoints, i)
|
table.remove(self.waypoints, i)
|
||||||
end
|
end
|
||||||
self.waypoints={}
|
--self.waypoints={}
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set (new) cargo status.
|
--- Set (new) cargo status.
|
||||||
@@ -6768,7 +6774,7 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
|||||||
local Coordinate=Carrier.unit:GetCoordinate()
|
local Coordinate=Carrier.unit:GetCoordinate()
|
||||||
|
|
||||||
-- Clear all waypoints.
|
-- Clear all waypoints.
|
||||||
self:ClearWaypoints()
|
self:ClearWaypoints(self.currentwp+1)
|
||||||
|
|
||||||
if self.isArmygroup then
|
if self.isArmygroup then
|
||||||
local waypoint=ARMYGROUP.AddWaypoint(self, Coordinate) ; waypoint.detour=0
|
local waypoint=ARMYGROUP.AddWaypoint(self, Coordinate) ; waypoint.detour=0
|
||||||
|
|||||||
Reference in New Issue
Block a user