fix: fuldt mål springer det fulde mål over ved tømning (1.62.371)

This commit is contained in:
2026-10-19 11:49:46 +02:00
parent d9ac0216ed
commit 686e52ed96
4 changed files with 15 additions and 9 deletions
+7 -2
View File
@@ -950,7 +950,8 @@ end
-- Én traktor hjem (fra et stoppet/slettet flow): tøm først, så parkering.
-- reason: "stop" (et kørende flow stoppes: vognen huskes) | "afterLoad" (oprydning: intet huskes)
function ADFlowWagons.homeVehicle(adEnv, vehicle, runName, reason)
-- avoidMarkerId: et mål der ikke må bruges som tømmested (det fulde mål vognen lige holdt ved — ADStrayUnload)
function ADFlowWagons.homeVehicle(adEnv, vehicle, runName, reason, avoidMarkerId)
waiting[vehicle] = nil
if ADFlowWagons.shouldRememberOnHome(reason or "stop") then
rememberWagonOf(vehicle) -- vognen sættes af nu: flowet skal kunne finde den igen ved næste start
@@ -970,6 +971,9 @@ function ADFlowWagons.homeVehicle(adEnv, vehicle, runName, reason)
local second = module ~= nil and module.getSecondMarker ~= nil and module:getSecondMarker() or nil
local run = ADRunsController.getRunForVehicle(vehicle)
local targetId = ADFlowWagons.emptyTarget(second ~= nil and second.id or nil, run ~= nil and run.targetWayPointIds or nil)
-- holdt ved et fuldt mål (ADStrayUnload): ikke tilbage til samme mål — direkte til et lager (in-game 19/10 11:46:
-- '1050 Vario 3' og 'Series 8 TTV 5' blev sendt til Fish Food/Oil Mill igen og stod 45 s, før de gik videre)
if reason == "strayFull" then targetId = nil end
local target = targetId ~= nil and adEnv.ADGraphManager:getMapMarkerByWayPointId(targetId) or nil
local cargo, fillType = cargoOf(adEnv, vehicle)
local action = ADFlowWagons.emptyStep("start", {cargo = cargo, hasTarget = target ~= nil})
@@ -978,7 +982,8 @@ function ADFlowWagons.homeVehicle(adEnv, vehicle, runName, reason)
-- sjældent i ét lager — review 19/10: 595.538 l soja kørte ellers bare hjem med læsset)
local state = {stage = action, since = nowMs, runName = runName,
markerId = target ~= nil and target.id or nil, markerName = target ~= nil and target.name or nil,
partial = reason == "strayFull" or reason == "playerClaim"}
partial = reason == "strayFull" or reason == "playerClaim",
triedMarkers = avoidMarkerId ~= nil and {[avoidMarkerId] = true} or nil}
emptying[vehicle] = state
if action == "target" then
ADFieldWork.startAd(adEnv, vehicle, adEnv.AutoDrive.MODE_DELIVERTO, target.id, nil, fillType)