Skip to content

Commit 16694e3

Browse files
antler22claude
andcommitted
Fix item 10: restrict combine-relocation re-path to manual combines only
Per pvaiko's review: CP-driven combines have their own rendezvous/waypoint system and must not be affected by the periodic re-pathfinding logic. Add isManualProxy guard so the re-dispatch only fires when the target is a CpManualCombineProxy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bea655f commit 16694e3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,16 +1972,20 @@ function AIDriveStrategyUnloadCombine:driveToCombine()
19721972

19731973
self:getCombineStrategy():reconfirmRendezvous()
19741974

1975-
-- If the combine has moved significantly since the current approach course was generated,
1976-
-- re-pathfind to its new position so we don't drive to an empty spot.
1975+
-- For manually-driven combines only: if the combine has moved significantly since the
1976+
-- approach course was generated, re-pathfind to its new position so we don't drive to
1977+
-- an empty spot. CP combines use their own rendezvous/waypoint system and must not be
1978+
-- affected by this extra re-dispatch.
19771979
-- Guards keep this infrequent and fast:
19781980
-- • only check every 5 s (cheap distance math)
19791981
-- • skip if remaining course < 20 m (almost there — let proximity handling finish)
19801982
-- • skip if already within 25 m of the combine (driveBesideCombine takes over soon)
19811983
-- • only trigger when the combine has actually moved ≥ 30 m (genuine relocation)
19821984
-- Uses a capped iteration count (defaultMaxIterations) so the A* search completes in
19831985
-- well under a second on any field size, minimising the WAITING_FOR_PATHFINDER stop.
1984-
if g_time - (self.lastCombinePositionCheckTime or 0) > 5000 then
1986+
local combineStrategyForRepath = self:getCombineStrategy()
1987+
if combineStrategyForRepath and combineStrategyForRepath.isManualProxy and
1988+
g_time - (self.lastCombinePositionCheckTime or 0) > 5000 then
19851989
self.lastCombinePositionCheckTime = g_time
19861990
local remainingDist = self.course:getDistanceToLastWaypoint(self.course:getCurrentWaypointIx())
19871991
local distToCombine = self:getDistanceFromCombine()

0 commit comments

Comments
 (0)