From 74dfbfe6f8713c42819159ef2f9a961a49d5dbcc Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 6 Nov 2020 16:04:33 +1100 Subject: [PATCH] - Duke/RR: Ensure `p->vehForwardScale`/`p->vehReverseScale` can only be a maximum of 1. Controller input with high sensitivity could effectively turbo-charge the bike ;) --- source/games/duke/src/input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 26b4a7766..d813002e2 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -775,8 +775,8 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I if (p->OnBoat || !p->moto_underwater) { - p->vehForwardScale = (buttonMap.ButtonDown(gamefunc_Move_Forward) || buttonMap.ButtonDown(gamefunc_Strafe)) + hidInput->dz; - p->vehReverseScale = buttonMap.ButtonDown(gamefunc_Move_Backward) + -hidInput->dz; + p->vehForwardScale = std::min((buttonMap.ButtonDown(gamefunc_Move_Forward) || buttonMap.ButtonDown(gamefunc_Strafe)) + hidInput->dz, 1.f); + p->vehReverseScale = std::min(buttonMap.ButtonDown(gamefunc_Move_Backward) + -hidInput->dz, 1.f); if (loc.actions & SB_RUN) loc.actions |= SB_CROUCH;