fix(status): valgt lager der ikke kan bruges viser den præcise grund i status (ikke 'intet lager med plads') (v1.19.10.0)
This commit is contained in:
@@ -210,6 +210,7 @@ local function findStoreMarker(adEnv, vehicle, product, capacity, sources, liter
|
||||
end
|
||||
end
|
||||
if hasForcedShed then
|
||||
product.storeReason = table.concat(reasons, "; ")
|
||||
warnOnce(adEnv, vehicle, "forcedShed:" .. tostring(product.name) .. ":" .. table.concat(reasons, ";"), string.format("'%s': %s kan ikke sættes på lager — %s", tostring(ADRuns.vehicleLabel(vehicle)), tostring(product.name), table.concat(reasons, "; ")))
|
||||
return nil
|
||||
end
|
||||
@@ -233,6 +234,7 @@ local function findStoreMarker(adEnv, vehicle, product, capacity, sources, liter
|
||||
if #forced > 0 and ADLoadSwap.findForcedDumpMarker ~= nil then
|
||||
local chosen, why = ADLoadSwap.findForcedDumpMarker(adEnv, vehicle, product.fillType, liters, forced, isReachable)
|
||||
if chosen == nil then
|
||||
product.storeReason = tostring(why)
|
||||
warnOnce(adEnv, vehicle, "forced:" .. tostring(product.name) .. ":" .. tostring(why), string.format("'%s': %s kan ikke læsses af — %s", tostring(ADRuns.vehicleLabel(vehicle)), tostring(product.name), tostring(why)))
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -103,6 +103,9 @@ local function reasonFor(product, e, input)
|
||||
return product.name .. ": intet nåeligt salgssted"
|
||||
end
|
||||
if wantsStore(product.policy) and product.store == nil and (e.fullLoad or e.storageHigh) and not e.priceOk then
|
||||
if product.storeReason ~= nil then
|
||||
return product.name .. ": " .. product.storeReason
|
||||
end
|
||||
return product.name .. ": intet lager med plads (silo eller egen fabrik der bruger varen)"
|
||||
end
|
||||
local parts = {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.19.9.0</version>
|
||||
<version>1.19.10.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user