fix(bredde): forældet CP-bredde <1,5 m ignoreres -> AI-markører; diag: triggere ved mål der afvises (v1.62.244)

This commit is contained in:
2026-10-16 03:06:48 +02:00
parent 60010ee8ba
commit c55da307a1
5 changed files with 30 additions and 6 deletions
+9 -2
View File
@@ -166,10 +166,17 @@ local function findOtherTargetForRest(adEnv, vehicle, fillType, currentId, diag)
-- triggeren ved markøren skal tage varen, ikke bare stationen (foder til en halm-markør, in-game 14/10)
local enough = free ~= nil and free > bestFree
local takes = enough and markerTakes(adEnv, vehicle, targetId, fillType)
-- diagnose: hvorfor siger triggeren nej (bygning + triggere med afstand)
local triggerWhy = ""
if diag ~= nil and enough and not takes and ADSmartPickup.markerTriggerAccepts ~= nil then
local why = {}
pcall(ADSmartPickup.markerTriggerAccepts, adEnv, targetId, fillType, ADSmartPickup.getFarmId(vehicle), why)
triggerWhy = #why > 0 and (" [" .. table.concat(why, ", ") .. "]") or ""
end
local route = takes and hasRouteTo(adEnv, vehicle, targetId)
if diag ~= nil then
table.insert(diag, string.format("%s: fri %s, trigger %s, vej %s", name, free ~= nil and string.format("%.0f l", free) or "ukendt",
enough and tostring(takes) or "-", takes and tostring(route) or "-"))
table.insert(diag, string.format("%s: fri %s, trigger %s%s, vej %s", name, free ~= nil and string.format("%.0f l", free) or "ukendt",
enough and tostring(takes) or "-", triggerWhy, takes and tostring(route) or "-"))
end
if route then
best, bestFree = {id = targetId, name = name}, free