diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index e65a227b6..3751c2d9e 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -21,6 +21,7 @@ extern bool GUICapture; extern bool AppActive; extern cycle_t drawtime, actortime, thinktime, gameupdatetime; extern bool r_NoInterpolate; +extern bool crouch_toggle; struct MapRecord; extern MapRecord* g_nextmap; diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index 29e094e19..ca660482f 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -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); diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index 75b5b2f4a..66694dc1d 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -75,6 +75,21 @@ CVAR(String, cl_savedir, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // //============================================================================= +static void SerializeGlobals(FSerializer& arc) +{ + if (arc.BeginObject("globals")) + { + arc("crouch_toggle", crouch_toggle) + .EndObject(); + } +} + +//============================================================================= +// +// +// +//============================================================================= + static void SerializeSession(FSerializer& arc) { SerializeMap(arc); @@ -85,6 +100,7 @@ static void SerializeSession(FSerializer& arc) S_SerializeSounds(arc); SerializeAutomap(arc); SerializeHud(arc); + SerializeGlobals(arc); } //=============================================================================