- InputState::ClearAllInput(): Only clear crouch_toggle bool if outside of a level, and resend SB_CROUCH sync bit if inside a level and crouch_toggle is true.

* Fixes #287.
This commit is contained in:
Mitchell Richters 2021-04-01 13:46:16 +11:00
parent 4321efa21c
commit c076310e34

View file

@ -119,13 +119,26 @@ void InputState::ClearAllInput()
{
memset(KeyStatus, 0, sizeof(KeyStatus));
AnyKeyStatus = false;
ActionsToSend = 0;
WeaponToSend = 0;
dpad_lock = 0;
lastCheck = 0;
crouch_toggle = false;
if (gamestate != GS_LEVEL)
{
ActionsToSend = 0;
crouch_toggle = false;
gi->clearlocalinputstate(); // also clear game local input state.
}
else if (gamestate == GS_LEVEL && crouch_toggle)
{
ActionsToSend |= SB_CROUCH;
}
else
{
ActionsToSend = 0;
}
buttonMap.ResetButtonStates(); // this is important. If all input is cleared, the buttons must be cleared as well.
gi->clearlocalinputstate(); // also clear game local input state.
resetTurnHeldAmt();
}