fix(flows): traktorer der ikke findes længere fjernes fra flowet 2 min efter indlæsning (ikke hvis alle mangler); resuméet viser aldrig rå køretøjs-id (v1.59.6.0)

This commit is contained in:
2026-09-29 18:13:30 +02:00
parent 3d11ee9748
commit 45f58abcf0
7 changed files with 60 additions and 2 deletions
+7 -1
View File
@@ -429,7 +429,13 @@ local SUMMARY = {
local ids = guide.draft.vehicleIds
if #ids == 0 then return {L("spu_guide_flow_sumNoTractors")} end
if #ids > ADFlowGuide.MAX_NAMED_TRACTORS then return {L("spu_guide_flow_sumTractors", {#ids})} end
return {T(table.concat(namesFor(ids, guide.context.vehicles, "label"), ", "))}
-- traktorer der ikke findes (solgt, eller ikke indlæst endnu) vises ikke som rå id
local known = {}
for _, vehicle in ipairs(guide.context.vehicles or {}) do known[vehicle.id] = true end
local present = {}
for _, id in ipairs(ids) do if known[id] then table.insert(present, id) end end
if #present == 0 then return {L("spu_guide_flow_sumNoTractors")} end
return {T(table.concat(namesFor(present, guide.context.vehicles, "label"), ", "))}
end,
}