feat: flows kan låne en ledig traktor + aflæsnings-skub ved trigger undervejs (1.62.364)

This commit is contained in:
2026-10-19 10:37:26 +02:00
parent b1bb5e1ee8
commit 28fb5332c5
13 changed files with 276 additions and 16 deletions
+8 -2
View File
@@ -1340,7 +1340,11 @@ function ADRunsController.queueStartAll(adEnv)
local vehiclesById = getFarmVehiclesById(adEnv)
local queue = {}
for _, run in ipairs(ADRunsController.store.runs) do
if #run.vehicleIds > 0 then
if run.borrowWagonId ~= nil then
-- lånt traktor: "tændt" = venter i dvale på en tur (ADFlowSleep låner en traktor). En traktor der stadig er på vej
-- hjem, hentes ikke tilbage uden en tur (review 19/10) — den slippes, og vågn-tjekket låner igen ved arbejde
if run.stopped and not run.sleeping then run.sleeping = true end
elseif #run.vehicleIds > 0 then
local action = ADRuns.startAllAction(ADRunsController.getRunStatus(adEnv, run).isRunning, run.stopped == true)
if action ~= "queue" then
summary.alreadyRunning = summary.alreadyRunning + 1
@@ -1586,7 +1590,9 @@ end
function ADRunsController.startAllRuns(adEnv)
local summary = {runsStarted = 0, alreadyRunning = 0, vehiclesStarted = 0, results = {}}
for _, run in ipairs(ADRunsController.store.runs) do
if #run.vehicleIds > 0 then
if run.borrowWagonId ~= nil then
if run.stopped and not run.sleeping then run.sleeping = true end
elseif #run.vehicleIds > 0 then
local action = ADRuns.startAllAction(ADRunsController.getRunStatus(adEnv, run).isRunning, run.stopped == true)
if action ~= "queue" then
summary.alreadyRunning = summary.alreadyRunning + 1