fix(marker): arbejdsbredde = Courseplays egen workWidth-indstilling når den findes (v1.21.2.0)

In-game 25/9: variabel bredde gav 20,8 m for BiG M 450, Courseplay-HUD'en viser 40,8 m.
This commit is contained in:
2026-09-25 22:57:48 +02:00
parent bade84129b
commit 716045a36b
5 changed files with 22 additions and 3 deletions
+10
View File
@@ -44,7 +44,17 @@ local function variableWidth(object)
return nil
end
-- Courseplays egen bredde-indstilling (den i HUD'en) er den marken faktisk køres med.
local function courseplayWidth(vehicle)
if vehicle.getCourseGeneratorSettings == nil then return nil end
local ok, width = pcall(function() return vehicle:getCourseGeneratorSettings().workWidth:getValue() end)
if ok and type(width) == "number" and width > 0 then return width end
return nil
end
function ADCpBridge.getWorkWidth(vehicle)
local cpWidth = courseplayWidth(vehicle)
if cpWidth ~= nil then return cpWidth end
local best = 0
for _, object in ipairs(collect(vehicle)) do
local variable = variableWidth(object)
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.21.1.0</version>
<version>1.21.2.0</version>
<title>
<en>AD Smart Pickup</en>
</title>