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:
@@ -394,7 +394,14 @@ local function applyRunToVehicle(adEnv, run, vehicle, ingredients)
|
||||
-- bliver en silo der tager varen; næste tur sætter choosePickup målet tilbage til run'ets.
|
||||
local targetId = ADRunsController.chooseTarget(adEnv, run, vehicle) or run.targetWayPointId
|
||||
local dump = ADRunsController.findWrongCargoDump(adEnv, run, vehicle, targetId)
|
||||
stateModule:setSecondMarkerByWayPointId(dump ~= nil and dump.marker.id or targetId)
|
||||
stateModule:setSecondMarkerByWayPointId(targetId)
|
||||
if dump ~= nil then
|
||||
if ADUnloadWait ~= nil and ADUnloadWait.setDumpTarget ~= nil then
|
||||
ADUnloadWait.setDumpTarget(vehicle, dump.marker.id)
|
||||
else
|
||||
stateModule:setSecondMarkerByWayPointId(dump.marker.id)
|
||||
end
|
||||
end
|
||||
local loadMarker = findNearestLoadMarker(adEnv, vehicle, farmId)
|
||||
if loadMarker ~= nil then
|
||||
stateModule:setFirstMarkerByWayPointId(loadMarker.id)
|
||||
|
||||
@@ -623,6 +623,10 @@ local function chooseRunTarget(adEnv, driver)
|
||||
if run == nil or ADRunsController.chooseTarget == nil or #ADRunsController.getRunTargets(run) < 1 then
|
||||
return
|
||||
end
|
||||
-- Er AD's mål midlertidigt en silo (forkert last læsses af), må det ikke røres nu.
|
||||
if ADUnloadWait ~= nil and ADUnloadWait.getPendingTargetRestore ~= nil and ADUnloadWait.getPendingTargetRestore(driver) ~= nil then
|
||||
return
|
||||
end
|
||||
local stateModule = driver.ad.stateModule
|
||||
local targetId = ADRunsController.chooseTarget(adEnv, run, driver)
|
||||
local current = stateModule.getSecondMarker ~= nil and stateModule:getSecondMarker() or nil
|
||||
|
||||
@@ -265,6 +265,19 @@ function ADUnloadWait.getPendingTargetRestore(vehicle)
|
||||
return pendingTargetRestore[vehicle]
|
||||
end
|
||||
|
||||
-- Ved Start med forkert last: AD's mål peger på siloen indtil aflæsningen er færdig;
|
||||
-- det oprindelige mål gendannes af finished-hook'en.
|
||||
function ADUnloadWait.setDumpTarget(vehicle, dumpWayPointId)
|
||||
local stateModule = vehicle.ad.stateModule
|
||||
local current = stateModule.getSecondMarker ~= nil and stateModule:getSecondMarker() or nil
|
||||
if current ~= nil and current.id ~= dumpWayPointId then
|
||||
pendingTargetRestore[vehicle] = pendingTargetRestore[vehicle] or current.id
|
||||
end
|
||||
if stateModule.setSecondMarkerByWayPointId ~= nil then
|
||||
stateModule:setSecondMarkerByWayPointId(dumpWayPointId)
|
||||
end
|
||||
end
|
||||
|
||||
-- Hvem holder hvor (GUI'ets Wait-puljer-visning). Sorteret på mappe, dernæst markør-id.
|
||||
-- Vognens indhold (største enhed) og evt. Wait-tilstand — til overblikket i fanen.
|
||||
function ADUnloadWait.hasRouteBothWays(adEnv, vehicle, toWayPointId, homeWayPointId)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.11.9.0</version>
|
||||
<version>1.11.10.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
Reference in New Issue
Block a user