fix: slut-review — pcall om start/dialoger, Auto-varer fra aktivt AD-mål, nil-guards, README
This commit is contained in:
@@ -53,12 +53,15 @@ function ADLoadSwap.findDumpMarker(adEnv, vehicle, fillType, rest, homeWayPointI
|
||||
local station = ADSmartPickup.getUnloadStationAtWayPointId(adEnv, marker.id, farmId)
|
||||
if station ~= nil and isSilo(station, homeStation) and acceptsRest(station, fillType, rest, farmId) then
|
||||
local wayPoint = adEnv.ADGraphManager:getWayPointById(marker.id)
|
||||
local dx, dz = wayPoint.x - x, wayPoint.z - z
|
||||
table.insert(candidates, {
|
||||
marker = marker,
|
||||
hasFillType = ADSmartPickup.getOwnStorageLevel(station, {fillType}) > 0,
|
||||
distance = dx * dx + dz * dz,
|
||||
})
|
||||
-- En markør uden waypoint (stale AD-graf) skal springes over, ikke crashe hele opslaget.
|
||||
if wayPoint ~= nil then
|
||||
local dx, dz = wayPoint.x - x, wayPoint.z - z
|
||||
table.insert(candidates, {
|
||||
marker = marker,
|
||||
hasFillType = ADSmartPickup.getOwnStorageLevel(station, {fillType}) > 0,
|
||||
distance = dx * dx + dz * dz,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(candidates, function(a, b)
|
||||
|
||||
Reference in New Issue
Block a user