fix(marker): vinhøster — lille CP-bredde erstattes af 3 m (v1.60.20.0)

This commit is contained in:
2026-09-29 23:50:34 +02:00
parent a6506fea4e
commit c415bdc7a4
3 changed files with 10 additions and 5 deletions
+8 -4
View File
@@ -394,16 +394,20 @@ end
-- Vinhøster uden AI-markører: bredden er vinrækken (3 m = Courseplays vin-gitter for druer).
ADCpBridge.VINE_ROW_WIDTH = 3
function ADCpBridge.widthOrVine(width, hasVineCutter)
if hasVineCutter and (width or 0) < 1 then return ADCpBridge.VINE_ROW_WIDTH end
-- under markarbejdets minimum (1,5 m) — også en lille bredde fra Courseplay (in-game 29/9: stadig widthUnknown)
if hasVineCutter and (width or 0) < 1.5 then return ADCpBridge.VINE_ROW_WIDTH end
return width
end
function ADCpBridge.getWorkWidth(vehicle)
local cpWidth = courseplayWidth(vehicle)
if cpWidth ~= nil then return cpWidth end
local best, hasVine = 0, false
local hasVine = false
for _, object in ipairs(collect(vehicle)) do
if object.spec_vineCutter ~= nil then hasVine = true end
end
local cpWidth = courseplayWidth(vehicle)
if cpWidth ~= nil then return ADCpBridge.widthOrVine(cpWidth, hasVine) end
local best = 0
for _, object in ipairs(collect(vehicle)) do
local variable = variableWidth(object)
if variable ~= nil then
best = math.max(best, variable)