fix: salgsmarkør skal køre gennem stationens trigger (v1.62.50)

This commit is contained in:
2026-10-06 19:40:31 +02:00
parent c9792950f0
commit 2b36303756
5 changed files with 44 additions and 8 deletions
+16
View File
@@ -227,6 +227,22 @@ local function getUnloadCandidates()
return list
end
-- Stationens aflæsningstriggere i verden -> {{x, z}}
function ADSmartPickup.unloadTriggerPoints(station)
local points = {}
for _, trigger in pairs(station ~= nil and station.unloadTriggers or {}) do
for _, field in ipairs(UNLOAD_TRIGGER_NODE_FIELDS) do
local node = trigger[field]
if node ~= nil and entityExists(node) then
local x, _, z = getWorldTranslation(node)
table.insert(points, {x = x, z = z})
break
end
end
end
return points
end
local function getUnloadStationAtMarker(adEnv, wayPoint, farmId)
return getClosestStation(adEnv, getUnloadCandidates(), "unloadTriggers", UNLOAD_TRIGGER_NODE_FIELDS, wayPoint, farmId)
end