feat(ui): 'Lager til' viser kun bygninger der kan tage flowets lagervarer (paller -> palleskure der tager varen); valgt palleskur bruges til palleture (v1.19.2.0)
This commit is contained in:
@@ -185,6 +185,23 @@ local function findStoreMarker(adEnv, vehicle, product, capacity, sources, liter
|
||||
end
|
||||
-- paller lagres i et palleskur (objektlager) — UAL læsser af dér
|
||||
if product.isPallet then
|
||||
-- "Lager til" med palleskure: første valgte der tager varen, har plads og kan nås
|
||||
local forcedSheds = run ~= nil and ADRunsController ~= nil and ADRunsController.getStoreBuildings ~= nil and ADRunsController.getStoreBuildings(adEnv, run) or {}
|
||||
local hasForcedShed = false
|
||||
for _, building in ipairs(forcedSheds) do
|
||||
if building.kind == "objectStorage" then
|
||||
hasForcedShed = true
|
||||
local marker = building.unloadMarker or building.loadMarker
|
||||
if marker ~= nil and ADSources.objectStorageAccepts(building.placeable, product.fillType)
|
||||
and ADSources.objectStorageFreeSlots(building.placeable) >= 1 and isReachable(marker.id) then
|
||||
return {wayPointId = marker.id, name = tostring(building.name), free = ADSources.objectStorageFreeSlots(building.placeable)}
|
||||
end
|
||||
end
|
||||
end
|
||||
if hasForcedShed then
|
||||
warnOnce(adEnv, vehicle, "forcedShed:" .. tostring(product.name), string.format("'%s': %s kan ikke sættes på lager — intet af de valgte palleskure tager varen, har plads og kan nås", tostring(ADRuns.vehicleLabel(vehicle)), tostring(product.name)))
|
||||
return nil
|
||||
end
|
||||
if ADSources.findPalletStore == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user