fix(udkørsel): 'Wait at: All' vælger det ledige Wait-punkt nærmest flowets kilder, ikke nærmest traktoren (v1.57.1.0)

This commit is contained in:
2026-09-29 15:23:14 +02:00
parent 793f792f8b
commit a694d17a67
4 changed files with 29 additions and 3 deletions
+11 -1
View File
@@ -493,7 +493,17 @@ local function startHold(adEnv, vehicle, run, reasons, sourcesById)
local isReachable = function(candidate)
return ADWaitPool.hasRouteTo(adEnv, vehicle, candidate.marker.id)
end
local candidate = ADWaitPool.pickFree(adEnv, vehicle, run.waitPoolGroup, isReachable)
-- "All": nærmest flowets egne kilder, ikke nærmest traktoren (in-game 29/9: Milk Store ved sukkerroeknuseren)
local anchorX, anchorZ = nil, nil
if run.waitPoolGroup == nil then
local points = {}
for _, id in ipairs(run.sourceWayPointIds or {}) do
local wayPoint = adEnv.ADGraphManager:getWayPointById(id)
if wayPoint ~= nil then table.insert(points, {x = wayPoint.x, z = wayPoint.z}) end
end
anchorX, anchorZ = ADWaitPool.anchorOf(points)
end
local candidate = ADWaitPool.pickFree(adEnv, vehicle, run.waitPoolGroup, isReachable, anchorX, anchorZ)
local marker, source = nil, nil
if candidate ~= nil then
ADWaitPool.claim(candidate.marker.id, vehicle)