fix: forældet kilde-advarsel ryddes i flowets status (1.62.357)

This commit is contained in:
2026-10-19 01:29:33 +02:00
parent 03c1943016
commit 636b161103
3 changed files with 13 additions and 1 deletions
+11
View File
@@ -150,7 +150,12 @@ end
local function clearWarning(vehicle, key)
if warned[vehicle] ~= nil then
local text = warned[vehicle][key]
warned[vehicle][key] = nil
-- også flowets status, hvis det var denne advarsel (in-game 19/10: "kilde-markør 28536 …" stod i flowet efter
-- indlæsningen, længe efter markøren var fulgt — status ryddes ellers kun, når en tur planlægges)
local run = text ~= nil and getRun(vehicle) or nil
if run ~= nil and getStatus(run).warning == text then getStatus(run).warning = nil end
end
end
@@ -508,6 +513,12 @@ function ADOutbound.buildPlanInput(adEnv, run, vehicle)
carriable[fillType] = true
end
local sources, sourcesById = {}, {}
-- advarsler om kilder, der ikke længere er med (markøren blev fulgt/fjernet efter omnummerering), ryddes
local current = {}
for _, wayPointId in ipairs(run.sourceWayPointIds or {}) do current["source:" .. tostring(wayPointId)] = true end
for key in pairs(warned[vehicle] or {}) do
if string.sub(key, 1, 7) == "source:" and not current[key] then clearWarning(vehicle, key) end
end
for _, wayPointId in ipairs(run.sourceWayPointIds or {}) do
local source = ADSources.identify(adEnv, wayPointId, farmId)
if source == nil then