fix: silo-mål ved Start holdes indtil aflæsningen er færdig (mål-gendannelse venter), så forkert last ikke kører i ring (v1.11.10.0)

This commit is contained in:
2026-09-23 02:36:46 +02:00
parent 59b32b4d84
commit 0821353b54
5 changed files with 55 additions and 2 deletions
+29
View File
@@ -964,6 +964,35 @@ UnloadTask.update(tw, ADLoadSwap.CHECK_INTERVAL_MS + 1)
check("V2 fra Wait til silo selv uden manglende vare", tw.destinationID, 21)
waitBarnCapacity[STRAW] = 50000
-- V3: Start med forkert last -> AD's mål = silo; første getNextPickup må IKKE sætte run-målet tilbage,
-- og efter aflæsningen (finished) gendannes run-målet
buildCowWorld()
table.insert(unloadStations, stations[2]) -- halmladen tager halm
stations[2].unloadTriggers = {{exactFillRootNode = 121}}
stations[2].getIsFillTypeSupported = function(_, fillType) return fillType == STRAW end
stations[2].getFreeCapacity = function() return 100000 end
stations[2].owningPlaceable = {spec_silo = {storages = {{getFillLevel = function() return 0 end}}}}
local v3 = makeSupplyDriver(markerByIndex(21), markerByIndex(30), {TMR, STRAW})
v3.uniqueId = "vehicleV3"; v3.carriable = {TMR}; v3.trailers = {level = 4000, capacity = 8000}; v3.rootNode = 571; nodePositions[571] = {x = 0, z = 0}
v3.units = {{object = {getFillUnitFillLevel = function() return 4000 end, getFillUnitFillType = function() return STRAW end}, fillUnitIndex = 1}}
v3.ad.stateModule.secondMarkerId = 30
v3.ad.stateModule.setSecondMarkerByWayPointId = function(self, id) self.secondMarkerId = id end
v3.ad.stateModule.getSecondMarker = function(self) return markerByIndex(self.secondMarkerId) end
cowLevels[STRAW] = nil -- stald 1 tager i denne test kun TMR
unloadStations[1].getIsFillTypeSupported = function(_, fillType) return fillType == TMR end
testVehicles = {v3}
ADRunsController.store = ADRuns.newStore()
local v3Run = ADRunsController.createRun("TMR only")
ADRunsController.updateRun(v3Run.id, {targetWayPointId = 30, ingredientMode = "manual", ingredients = {"FORAGE"}})
ADRunsController.assignVehicle(v3Run.id, v3)
ADUnloadWait.setDumpTarget(v3, 21) -- som Start gør ved forkert last
check("V3 AD's mål = silo", v3.ad.stateModule.secondMarkerId, 21)
manager:getNextPickup(v3, false)
check("V3 getNextPickup rører ikke målet mens silo-aflæsning er undervejs", v3.ad.stateModule.secondMarkerId, 21)
UnloadTask.finished({vehicle = v3})
check("V3 mål gendannet efter aflæsning", v3.ad.stateModule.secondMarkerId, 30)
ADRunsController.store = ADRuns.newStore()
-- ==== E: eksponerede opslag (bruges af runs-controller og læs-bytte) ====
local eDriver = buildCowWorld()
check("E1 aflæsningsstation ved waypoint", ADSmartPickup.getUnloadStationAtWayPointId(FS25_AutoDrive, 30, 1), unloadStations[1])