Skip to content

Commit

Permalink
fix: tight turn offset reset in turns
Browse files Browse the repository at this point in the history
  • Loading branch information
pvaiko committed Sep 29, 2024
1 parent 01e3761 commit 8f1c9d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/ai/turns/AITurn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,13 @@ function CourseTurn:onWaypointChange(ix)
if self.turnCourse then
if self.forceTightTurnOffset or (self.enableTightTurnOffset and self.turnCourse:useTightTurnOffset(ix)) then
-- adjust the course a bit to the outside in a curve to keep a towed implement on the course
-- TODO_22
self.tightTurnOffset = AIUtil.calculateTightTurnOffset(self.vehicle, self.turningRadius, self.turnCourse,
self.tightTurnOffset, true)
self.turnCourse:setOffset(self.tightTurnOffset, 0)
else
-- reset offset to 0 if tight turn offset is not on
self.tightTurnOffset = 0
self.turnCourse:setOffset(0, 0)
end
end
end
Expand Down

0 comments on commit 8f1c9d8

Please sign in to comment.