Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/specializations/CpVehicleSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,11 @@ end
---@return table texts
---@return any correct current value after max speed adjustment
function CpVehicleSettings:generateSpeedSettingValuesAndTexts(setting, lastValue)
local maxSpeed = self.getCruiseControlMaxSpeed and self:getCruiseControlMaxSpeed()
maxSpeed = maxSpeed or setting.data.max
local maxSpeed = setting.data.max
local cruiseControl = self.spec_drivable and self.spec_drivable.cruiseControl
if cruiseControl then
maxSpeed = math.max(cruiseControl.maxSpeed, cruiseControl.maxSpeedReverse)
end
local values, texts = {}, {}
for i = setting.data.min, maxSpeed, setting.data.incremental or 1 do
table.insert(values, i)
Expand Down
Loading