@@ -302,9 +302,15 @@ function TurnManeuver:adjustCourseToFitField(course, dBack, ixBeforeEndingTurnSe
302302 -- reversingOffset may be even behind the back marker, especially for vehicles which have a AIToolReverserDirectionNode
303303 -- which is then used as the PPC controlled node, and thus it must be far enough that we reach the lowering
304304 -- point before the controlled node reaches the end of the course
305+ local from = dFromTurnEnd + self .steeringLength - 1
306+ local to = math.min (dFromTurnEnd , self .turnContext .backMarkerDistance , - reversingOffset )
307+ -- if the reverse section is shorter than 1 m (or, even negative, meaning to > from), make sure we still
308+ -- have a short, 1 m reversing section.
309+ if from - to < 1 then
310+ to = from - 1
311+ end
305312 local reverseAfterTurn = Course .createFromNode (self .vehicle , self .turnContext .vehicleAtTurnEndNode ,
306- 0 , dFromTurnEnd + self .steeringLength - 1 ,
307- math.min (dFromTurnEnd , self .turnContext .backMarkerDistance , - reversingOffset ), - 0.8 , true )
313+ 0 , from , to , - 0.8 , true )
308314 courseWithReversing :append (reverseAfterTurn )
309315 endingTurnLength = reverseAfterTurn :getLength ()
310316 elseif self .turnContext .turnEndForwardOffset <= 0 and dFromTurnEnd >= 0 then
0 commit comments