- Ensure crouch_toggle is cleared when clearing all input.

This commit is contained in:
Mitchell Richters 2023-09-24 15:53:39 +10:00
parent f35e8eecf1
commit 22077c5b50
2 changed files with 14 additions and 6 deletions

View file

@ -80,6 +80,19 @@ bool scaletozero(DAngle& angle, const double scale, const double push)
}
//---------------------------------------------------------------------------
//
// Clears entire game input state.
//
//---------------------------------------------------------------------------
void GameInput::Clear()
{
memset(this, 0, sizeof(*this));
crouch_toggle = false;
}
//---------------------------------------------------------------------------
//
// Player's movement function, called from game's ticker or from gi->doPlayerMovement() as required.

View file

@ -60,12 +60,6 @@ public:
ActionsToSend |= action;
}
// Clear all values within this object.
void Clear()
{
memset(this, 0, sizeof(*this));
}
// Receives mouse input from OS for processing.
void MouseAddToPos(float x, float y)
{
@ -77,6 +71,7 @@ public:
void processMovement(PlayerAngles* const plrAngles, const float scaleAdjust, const int drink_amt = 0, const bool allowstrafe = true, const float turnscale = 1.f);
void processVehicle(PlayerAngles* const plrAngles, const float scaleAdjust, const float baseVel, const float velScale, const bool canMove, const bool canTurn, const bool attenuate);
void getInput(const double scaleAdjust, InputPacket* packet = nullptr);
void Clear();
};
struct PlayerAngles