Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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