feat: skår-tjek før vender/rive/opsamler — trin uden skår springes over — 1.62.331

Brugerspørgsmål 17/10 19:38 (4 mio. l hø samlet i hånden): ADWindrowCheck læser DensityMapHeightUtil.getFillLevelAtArea i 25 m-felter over markens omrids for info.windrow/info.hay (STRAW ved halmopsamling); under 200 l -> 'dispatch' bliver 'advance'. Cache 2 min pr. mark+trin, kontraktmarker undtaget, kræver vellykkede opslag (API-fejl logges én gang og springer ikke over), glemmes ved tilbagespoling. Tests test_adWindrowCheck (23). Manualer opdateret.
This commit is contained in:
2026-10-17 19:52:29 +02:00
parent 273455b902
commit 5c6f4c7f32
6 changed files with 154 additions and 1 deletions
+6
View File
@@ -735,6 +735,11 @@ local function stepField(adEnv, info, env)
end
end
local decision = ADFieldJobs.decide(field, info, assignments, ADFieldJobs.now, env)
-- skår-faser uden skår på marken (spilleren samlede selv, 17/10): trinnet springes over som var det gjort
if decision.action == "dispatch" and ADWindrowCheck ~= nil and ADWindrowCheck.skipsStage ~= nil then
local okSkip, skip = pcall(ADWindrowCheck.skipsStage, adEnv, field, info)
if okSkip and skip then decision = {action = "advance", role = decision.role, noWindrow = true} end
end
ADFieldJobs.lastDecision[info.id] = decision
if decision.action == "start" then
local started = ADFieldModel.start(field, info.kind, info.needs, info.fruitName)
@@ -743,6 +748,7 @@ local function stepField(adEnv, info, env)
ADFieldJobs.log(info.id, "starter (%s: %s)", tostring(info.kind), started.stage)
ADFieldJobs.save()
elseif decision.action == "rewind" then
if ADWindrowCheck ~= nil and ADWindrowCheck.forget ~= nil then ADWindrowCheck.forget(info.id) end
ADFieldJobs.setField(ADFieldModel.with(field, {stage = "ready", retryAt = 0, reason = false}))
ADFieldJobs.waitingSince[info.id] = nil
ADFieldWork.windDownHelpers(adEnv, info.id, field.stage)