mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- Ensure crouch_toggle
bool from 6e3d414b3c
is serialised when saving game, and cleared when InputState::ClearAllInput()
is called.
This commit is contained in:
parent
59c72c923e
commit
f9f365a593
3 changed files with 19 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
Loading…
Reference in a new issue