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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user