fix: salgsmarkør skal køre gennem stationens trigger (v1.62.50)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user