- Ensure crouch_toggle bool from 6e3d414b3c is serialised when saving game, and cleared when InputState::ClearAllInput() is called.

This commit is contained in:
Mitchell Richters 2020-11-08 07:30:48 +11:00
parent 59c72c923e
commit f9f365a593
3 changed files with 19 additions and 3 deletions

View file

@ -46,7 +46,7 @@ static int WeaponToSend = 0;
ESyncBits ActionsToSend = 0;
static int dpad_lock = 0;
bool sendPause;
bool crouch_toggle;
static double lastCheck;
CVAR(Float, m_pitch, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) // Mouse speeds
@ -120,6 +120,7 @@ void InputState::ClearAllInput()
WeaponToSend = 0;
dpad_lock = 0;
lastCheck = 0;
crouch_toggle = false;
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.
}
@ -327,8 +328,6 @@ CCMD(pause)
}
static bool crouch_toggle;
void ApplyGlobalInput(InputPacket& input, ControlInfo* hidInput, bool const crouchable, bool const disableToggle)
{
if (WeaponToSend != 0) input.setNewWeapon(WeaponToSend);