fix: læs lager direkte fra produktionspunktet når targetStorages mangler (v1.1.0.0)
Genskabt efter disk-crash 2026-09-21: det oprindelige commit (d38366e) gik tabt som tomt objekt; indholdet er gendannet fra arbejdskopien. README udvidet med behovsstyret forsyning, test S10 dækker produktionspunkt-lageret.
This commit is contained in:
@@ -254,5 +254,14 @@ feeder = makeSupplyDriver(markerByIndex(1), markerByIndex(10), {HAY, GRASS})
|
||||
check("S9 fejl giver fallback", manager:getNextPickup(feeder, false), "ORIGINAL")
|
||||
check("S9 fejl logges som advarsel", logLines[#logLines]:sub(1, 4), "WARN")
|
||||
|
||||
-- S10: stationen eksponerer ikke targetStorages -> lageret læses fra produktionspunktet
|
||||
buildFeedWorld()
|
||||
local bareStation = unloadStations[1]
|
||||
local productionStorage = next(bareStation.targetStorages)
|
||||
bareStation.targetStorages = nil
|
||||
bareStation.owningPlaceable = {spec_productionPoint = {productionPoint = {storage = productionStorage}}}
|
||||
feeder = makeSupplyDriver(markerByIndex(1), markerByIndex(10), {HAY, GRASS, SILAGE})
|
||||
check("S10 lager læses fra produktionspunktet", manager:getNextPickup(feeder, false), 3)
|
||||
|
||||
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