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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user