Skip to content

Commit

Permalink
Merge pull request #2826 from Courseplay/turn-fix
Browse files Browse the repository at this point in the history
fix: reversing turn
  • Loading branch information
Tensuko authored Oct 3, 2023
2 parents 52cdf06 + 316bb61 commit 12623d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/ai/turns/AITurn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,9 @@ end
--- change direction as soon as the implement is aligned.
--- So check that here and force a direction change when possible.
function CourseTurn:changeDirectionWhenAligned()
if TurnManeuver.hasTurnControl(self.turnCourse, self.turnCourse:getCurrentWaypointIx(), TurnManeuver.CHANGE_DIRECTION_WHEN_ALIGNED) then
if self.ppc:getLastPassedWaypointIx() and
TurnManeuver.hasTurnControl(self.turnCourse, self.ppc:getLastPassedWaypointIx(),
TurnManeuver.CHANGE_DIRECTION_WHEN_ALIGNED) then
local aligned = self.driveStrategy:areAllImplementsAligned(self.turnContext.turnEndWpNode.node)
self:debug('aligned: %s', tostring(aligned))
if aligned then
Expand Down

0 comments on commit 12623d2

Please sign in to comment.