chore(markarbejde): log hvorfor ingen maskine sendes ud (alle optaget/ingen med rollen/…) én gang pr. ændring — før kun i fanen (v1.36.7.0)

This commit is contained in:
2026-09-27 13:44:26 +02:00
parent 29a142d3df
commit 2b3793eeaa
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -27,6 +27,7 @@ ADFieldWork.REFILL_ROLES = {seeder = true, fertilizer = true, limer = true, weed
local function log(...) ADFieldJobs.log(...) end
local function note(...) ADFieldJobs.note(...) end
local function now() return ADFieldJobs.now end
local lastNoRig = {}
-- ---- AutoDrive ----
@@ -390,8 +391,15 @@ function ADFieldWork.dispatch(adEnv, field, info, decision)
return
end
note(field.id, {reason = {key = "spu_field_reason_" .. tostring(why), role = role, args = args}, retryAt = now() + ADFieldWork.NO_RIG_RETRY_MS})
-- også i loggen (én gang pr. ændring): før stod grunden kun i fanen, og loggen var tavs (in-game 27/9)
local noRigKey = tostring(role) .. ":" .. tostring(why)
if lastNoRig[field.id] ~= noRigKey then
lastNoRig[field.id] = noRigKey
log(field.id, "ingen maskine sendt til %s: %s", tostring(role), tostring(why))
end
return
end
lastNoRig[field.id] = nil
local count = #rigs
local lanes = ADFieldModel.lanePositions(count)
for index, rig in ipairs(rigs) do