fix(markarbejde): forkert vare hældes kun ud som lille rest (≤10 %, ≤2000 l); fuld sprøjte/spreder bruges ikke til en anden opgave (100.000 l gødning blev hældt ud) (v1.32.4.0)

This commit is contained in:
2026-09-26 21:28:17 +02:00
parent a04c16552a
commit 59b6ac1e47
6 changed files with 39 additions and 12 deletions
+4 -1
View File
@@ -50,7 +50,10 @@ local function sortCandidates(candidates, role, x, z, requiredWidth, accept)
local dx, dz = candidate.x - x, candidate.z - z
-- spreder med en anden vare på skal tømmes først: kun hvis ingen anden kan
local wrongFill = candidate.filledRole ~= nil and candidate.filledRole ~= role
table.insert(usable, {candidate = candidate, distance = dx * dx + dz * dz, wrongFill = wrongFill})
-- fuld af en anden vare: bruges slet ikke til denne opgave (resten hældes kun ud når den er lille)
if not (wrongFill and candidate.dumpable == false) then
table.insert(usable, {candidate = candidate, distance = dx * dx + dz * dz, wrongFill = wrongFill})
end
elseif widthReason == nil then
widthReason, widthArgs = reason, args
end