This commit is contained in:
Frank
2020-10-09 17:10:24 +02:00
parent 591dd128ce
commit 7792381c36
2 changed files with 45 additions and 15 deletions

View File

@@ -388,18 +388,7 @@ function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Formation)
local wp=UTILS.DeepCopy(self.waypoints[n]) --Ops.OpsGroup#OPSGROUP.Waypoint
-- Do we want to drive on road to the next wp?
local onroad=wp.action==ENUMS.Formation.Vehicle.OnRoad
-- Current point.
local current=self:GetCoordinate():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OffRoad)
table.insert(waypoints, current)
-- Insert a point on road.
if onroad then
local current=self:GetClosestRoad():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad)
table.insert(waypoints, current)
end
local onroad=wp.action==ENUMS.Formation.Vehicle.OnRoad
-- Speed.
if Speed then
@@ -436,6 +425,17 @@ function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Formation)
-- Add waypoint.
table.insert(waypoints, wp)
-- Current point.
local current=self:GetCoordinate():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OffRoad)
table.insert(waypoints, 1, current)
-- Insert a point on road.
if onroad then
local current=self:GetClosestRoad():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad)
table.insert(waypoints, 2, current)
end
-- Debug output.
if false then