fix(udsendelse): retfærdig kø i udsendelsesporten — længst ventende sender næste maskine ud (v1.62.239)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user