mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-22 17:01:08 +00:00
- Clamp vehicle input to 1.5x the calculated velocity.
This commit is contained in:
parent
6ac2af9f3c
commit
14629e7b2b
1 changed files with 2 additions and 4 deletions
|
@ -210,6 +210,7 @@ void GameInput::processVehicle(PlayerAngles* const plrAngles, const float scaleA
|
|||
const auto kbdForwards = buttonMap.ButtonDown(gamefunc_Move_Forward) || buttonMap.ButtonDown(gamefunc_Strafe);
|
||||
const auto kbdBackward = buttonMap.ButtonDown(gamefunc_Move_Backward);
|
||||
thisInput.fvel = kbdForwards - kbdBackward + joyAxes[JOYAXIS_Forward];
|
||||
inputBuffer.fvel = clamp(inputBuffer.fvel + thisInput.fvel, -1.f, 1.f);
|
||||
|
||||
// This sync bit is the brake key.
|
||||
if (buttonMap.ButtonDown(gamefunc_Run)) inputBuffer.actions |= SB_CROUCH;
|
||||
|
@ -235,6 +236,7 @@ void GameInput::processVehicle(PlayerAngles* const plrAngles, const float scaleA
|
|||
thisInput.avel -= turnVel * joyAxes[JOYAXIS_Yaw];
|
||||
thisInput.avel += turnVel * kbdDir;
|
||||
thisInput.avel *= scaleAdjust;
|
||||
inputBuffer.avel = clamp(inputBuffer.avel + thisInput.avel, -turnVel * 1.5f, turnVel * 1.5f);
|
||||
if (kbdDir) updateTurnHeldAmt(scaleAdjust); else turnheldtime = 0;
|
||||
}
|
||||
else
|
||||
|
@ -242,10 +244,6 @@ void GameInput::processVehicle(PlayerAngles* const plrAngles, const float scaleA
|
|||
turnheldtime = 0;
|
||||
}
|
||||
|
||||
// add collected input to game's local input accumulation packet.
|
||||
inputBuffer.fvel = clamp(inputBuffer.fvel + thisInput.fvel, -1.00f, 1.00f);
|
||||
inputBuffer.avel = clamp(inputBuffer.avel + thisInput.avel, -179.f, 179.f);
|
||||
|
||||
// directly update player angles if we can.
|
||||
if (scaleAdjust < 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue