Skip to content

Commit

Permalink
workaround for #121
Browse files Browse the repository at this point in the history
  • Loading branch information
birgersp committed Nov 23, 2020
1 parent 2aa48b6 commit 8b03fa2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions autogft/taskgroup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,22 @@ function autogft_TaskGroup:forceAdvance()
waypoints[#waypoints + 1] = wp
end

addWaypoint(groupPos.x, groupPos.y)
-- addWaypoint(groupPos.x, groupPos.y)

-- Only use roads if group is at a certain distance away from destination
local usingRoads = (useRoads and groupToDestinationMag > self.usingRoadDistanceThresholdM)

-- If using roads, add on-road waypoints at position and destination
if usingRoads then
addWaypoint(groupPos.x + 1, groupPos.y + 1, true)
-- addWaypoint(groupPos.x + 1, groupPos.y + 1, true)
addWaypoint(destination.x, destination.y, true)
usingRoads = true
end

-- If not shortened, add overshoot waypoint off-road
if not shortened then
local overshoot = destination:plus(groupPos:times(-1)):normalize():scale(self.routeOvershootM):add(destination)
addWaypoint(overshoot.x, overshoot.y)
-- addWaypoint(overshoot.x, overshoot.y)
addWaypoint(destination.x + 1, destination.y + 1)
elseif not usingRoads then
-- If shortened and not using roads, add intermidiate waypoint off-road
Expand Down

0 comments on commit 8b03fa2

Please sign in to comment.