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>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# AD Smart Pickup — brugermanual
|
||||
|
||||
Version 1.19.9 · Farming Simulator 25 · tillæg til AutoDrive
|
||||
Version 1.19.10 · Farming Simulator 25 · tillæg til AutoDrive
|
||||
|
||||
*English version: [USER_MANUAL.md](USER_MANUAL.md)*
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# AD Smart Pickup — user manual
|
||||
|
||||
Version 1.19.9 · Farming Simulator 25 · add-on for AutoDrive
|
||||
Version 1.19.10 · Farming Simulator 25 · add-on for AutoDrive
|
||||
|
||||
*Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*
|
||||
|
||||
|
||||
@@ -167,5 +167,11 @@ check("P16 fodring: mål = valgt drop", tripFeed and tripFeed.targetWayPointId,
|
||||
local tinyProduct = product("LIQUIDMANURE", FORAGE, "store", {{wayPointId = 2, available = 3000, level = 3000, capacity = 500000}}, nil, feedStore)
|
||||
check("P16 fodring: under minimum -> ingen tur", P.plan(input({tinyProduct}, {capacity = 100000, feedMode = true})), nil)
|
||||
|
||||
-- P17: valgt lager ("Lager til") kan ikke bruges -> begrundelsen er den præcise grund, ikke "intet lager med plads"
|
||||
local blocked = product("EGG", FORAGE, "store", {{wayPointId = 2, available = 3000000, level = 3000000, capacity = 3500000}}, nil, nil)
|
||||
blocked.storeReason = "Bale & Pallet Storage: ingen vej til 'Chicken Storage Unload'"
|
||||
local _, reasons17 = P.plan(input({blocked}))
|
||||
check("P17 præcis grund i status", reasons17[1], "EGG: Bale & Pallet Storage: ingen vej til 'Chicken Storage Unload'")
|
||||
|
||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||
os.exit(failures == 0 and 0 or 1)
|
||||
|
||||
Reference in New Issue
Block a user