Skip to content

Commit

Permalink
Merge pull request #3569 from Courseplay/3563-bug_sp-failed-to-contin…
Browse files Browse the repository at this point in the history
…ue-with-the-headland-after-finished-with-the-rows

fix: added forgotten wait for pathfinder
  • Loading branch information
Tensuko authored Oct 29, 2024
2 parents 344b9e4 + d5aade4 commit 46addac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/ai/AIDriveStrategyFieldWorkCourse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,14 @@ function AIDriveStrategyFieldWorkCourse:startPathfindingToNextWaypoint(ix)
self.pathfinderController:registerListeners(self, self.onPathfindingDoneToNextWaypoint,
self.onPathfindingFailedToNextWaypoint)
self:debug('Start pathfinding to target waypoint %d, zOffset %.1f', ix + 1, zOffset)
self.state = self.states.WAITING_FOR_PATHFINDER
-- to have a course set while waiting for the pathfinder
self:startCourse(self.fieldWorkCourse, self.waypointToContinueOnFailedPathfinding)
self.pathfinderController:findPathToNode(context, targetNode, 0, zOffset)
end

function AIDriveStrategyFieldWorkCourse:onPathfindingFailedToNextWaypoint()
self:debug('Pathfinding to next waypoint failed, use alignment course instead')
self:createAlignmentCourse(self.fieldWorkCourse, ix)
self:debug('Pathfinding to next waypoint failed, continue directly at waypoint %d', self.waypointToContinueOnFailedPathfinding)
self.state = self.states.WORKING
self:startCourse(self.fieldWorkCourse, self.waypointToContinueOnFailedPathfinding)
end
Expand Down

0 comments on commit 46addac

Please sign in to comment.