fix: gennemløbsfabrikker (tørreri hvede->hvede) er ikke producenter i kæden ('Loop around Wheat'); pålæsnings-rulning måler til triggerens midte som diagnosen — 1.62.301

This commit is contained in:
2026-10-17 09:17:20 +02:00
parent 2fd40f5929
commit 42a8fb8dea
5 changed files with 40 additions and 16 deletions
+4 -1
View File
@@ -102,7 +102,10 @@ local function offsetsFor(adEnv, vehicle, task)
local nx, _, nz = getWorldTranslation(node)
for _, trigger in pairs(manager.getLoadTriggers() or {}) do
if manager.triggerSupportsFillType(trigger, fillType) then
local tx, _, tz = manager.getTriggerPos(trigger)
-- triggerens MIDTE (bounding-sfære), ikke nodens nulpunkt — samme mål som diagnosen (17/10)
local tx, _, tz = nil, nil, nil
if ADLoadDiag ~= nil and ADLoadDiag.triggerCenter ~= nil then tx, _, tz = ADLoadDiag.triggerCenter(trigger) end
if tx == nil then tx, _, tz = manager.getTriggerPos(trigger) end
if tx ~= nil and (tx ~= 0 or tz ~= 0) and math.sqrt((tx - nx) ^ 2 + (tz - nz) ^ 2) <= ADLoadRoll.SEARCH_RADIUS then
local x, _, z = worldDirectionToLocal(vehicle.rootNode, tx - nx, 0, tz - nz)
table.insert(offsets, {x = x, z = z, inBox = inBox(trigger, trailer, i)})