fix: puljen henter ikke spreder fuld af anden vare (v1.62.127)

This commit is contained in:
2026-10-09 21:27:52 +02:00
parent 79d37a5bc1
commit d6c89893d7
3 changed files with 11 additions and 4 deletions
+9 -3
View File
@@ -66,9 +66,14 @@ function ADPool.connectFor(parkName, markers)
return nil
end
local function hasRole(item, role)
return item.role == role or (item.roles ~= nil and item.roles[role] == true)
-- Kan redskabet tage opgaven? En spreder fuld af en ANDEN vare (fx 100.000 l kalk til en gødningsopgave) kan ikke:
-- kun en lille rest må hældes ud (dumpable). In-game 9/10: K105 med kalk hentet til gødning -> "stadig tom" ved marken.
function ADPool.hasRole(item, role)
if not (item.role == role or (item.roles ~= nil and item.roles[role] == true)) then return false end
local wrongFill = item.filledRole ~= nil and item.filledRole ~= role
return not (wrongFill and item.dumpable == false)
end
local hasRole = ADPool.hasRole
local function distanceSq(ax, az, bx, bz)
return (ax - bx) ^ 2 + (az - bz) ^ 2
@@ -518,7 +523,8 @@ function ADPool.collect(adEnv, isBusy)
local carries, capacity = ADPool.cargoOf(vehicle)
table.insert(implements, {carries = carries, capacity = capacity,
id = ADRunsController.getVehicleId(vehicle), vehicle = vehicle, name = ADRuns.vehicleLabel(vehicle),
role = role, roles = ADPool.rolesOf(role, specs.sprayRoles), x = x, z = z, width = ADCpBridge.getWorkWidth(vehicle),
role = role, roles = ADPool.rolesOf(role, specs.sprayRoles), filledRole = specs.filledRole, dumpable = specs.dumpable,
x = x, z = z, width = ADCpBridge.getWorkWidth(vehicle),
neededHp = neededHpOf(vehicle), ptoHp = ADPool.readPtoHp(vehicle), connectId = connect.id, parkId = park.id,
front = ADPool.isFrontImplement(park.name),
})