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:
@@ -97,8 +97,18 @@ local function otherVehiclePositions(vehicle)
|
||||
return positions
|
||||
end
|
||||
|
||||
function ADWaitPool.pickFree(adEnv, vehicle, poolGroup, isReachable)
|
||||
-- Midtpunkt af punkter {x, z} (fx flowets kilde-markører) -> x, z eller nil.
|
||||
function ADWaitPool.anchorOf(points)
|
||||
if points == nil or #points == 0 then return nil end
|
||||
local sx, sz = 0, 0
|
||||
for _, point in ipairs(points) do sx, sz = sx + point.x, sz + point.z end
|
||||
return sx / #points, sz / #points
|
||||
end
|
||||
|
||||
-- anchorX/anchorZ (valgfri): vælg nærmest dette punkt i stedet for traktoren (flow med "All": nærmest kilderne).
|
||||
function ADWaitPool.pickFree(adEnv, vehicle, poolGroup, isReachable, anchorX, anchorZ)
|
||||
local x, z = getVehiclePosition(vehicle)
|
||||
if anchorX ~= nil and anchorZ ~= nil then x, z = anchorX, anchorZ end
|
||||
if x == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user