Skip to content

Commit

Permalink
Vehicles - Mousewheel will set speed limiter value to even multiples (#…
Browse files Browse the repository at this point in the history
…8840)

* Vehicles - Mousewheel will set speed limiter value to multiples of 5

* Limit setting to whole numbers only
  • Loading branch information
PabstMirror authored Mar 17, 2022
1 parent f85ed21 commit 70f3f55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions addons/vehicles/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ GVAR(isSpeedLimiter) = false;
["ACE3 Vehicles", QGVAR(scrollUp), localize LSTRING(IncreaseSpeedLimit), {
if (GVAR(isSpeedLimiter)) then {
GVAR(speedLimit) = round (GVAR(speedLimit) + GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
GVAR(speedLimit) = 5 max GVAR(speedLimiterStep) * floor (GVAR(speedLimit) / GVAR(speedLimiterStep));
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
true
};
Expand All @@ -47,6 +48,7 @@ GVAR(isSpeedLimiter) = false;
["ACE3 Vehicles", QGVAR(scrollDown), localize LSTRING(DecreaseSpeedLimit), {
if (GVAR(isSpeedLimiter)) then {
GVAR(speedLimit) = round (GVAR(speedLimit) - GVAR(speedLimiterStep)) max (5 max GVAR(speedLimiterStep));
GVAR(speedLimit) = 5 max GVAR(speedLimiterStep) * ceil (GVAR(speedLimit) / GVAR(speedLimiterStep));
[["%1: %2", LSTRING(SpeedLimit), GVAR(speedLimit)]] call EFUNC(common,displayTextStructured);
true
};
Expand Down
2 changes: 1 addition & 1 deletion addons/vehicles/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"SLIDER",
LSTRING(SpeedLimiterStep),
ELSTRING(common,ACEKeybindCategoryVehicles),
[1, 10, 5, 0]
[1, 10, 5, -1] // whole numbers only
] call CBA_fnc_addSetting;

0 comments on commit 70f3f55

Please sign in to comment.