fix(udsendelse): retfærdig kø i udsendelsesporten — længst ventende sender næste maskine ud (v1.62.239)

This commit is contained in:
2026-10-16 02:20:18 +02:00
parent db89110b02
commit 97d56c1322
7 changed files with 82 additions and 25 deletions
+6 -3
View File
@@ -768,11 +768,14 @@ local function stepField(adEnv, info, env)
elseif decision.action == "dispatch" then
-- én udsendelse ad gangen på tværs af markerne: marken prøver igen ved næste tick
-- fælles port: også "Start alle", marksiloer og flows tæller med (in-game 16/10)
if ADLaunchGate ~= nil and not ADLaunchGate.isOpen() then return end
if ADLaunchGate ~= nil and not ADLaunchGate.isOpen("fieldWork") then return end
local before = ADFieldJobs.assignmentCount()
ADFieldWork.dispatch(adEnv, field, info, decision)
if ADFieldJobs.assignmentCount() > before then
if ADLaunchGate ~= nil then ADLaunchGate.markLaunched() end
local launched = ADFieldJobs.assignmentCount() > before
if ADLaunchGate ~= nil then
if launched then ADLaunchGate.markLaunched("fieldWork") else ADLaunchGate.done("fieldWork") end
end
if launched then
ADFieldJobs.waitingSince[info.id] = nil
elseif ADFieldJobs.waitingSince[info.id] == nil then
ADFieldJobs.waitingSince[info.id] = ADFieldJobs.now