2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-23 02:16:01 +01:00

Protect sensitivity cvar.

This commit is contained in:
Andrey Akhmichin 2024-10-14 03:54:41 +05:00
parent 22f4f3b7e0
commit 006d8308c3
3 changed files with 6 additions and 2 deletions

View File

@ -1592,7 +1592,7 @@ void GoldSourceInput::IN_Init (void)
{
ignoreNextDelta = false;
m_filter = gEngfuncs.pfnRegisterVariable ( "m_filter","0", FCVAR_ARCHIVE );
sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE ); // user mouse sensitivity setting.
sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE | FCVAR_FILTERSTUFFTEXT ); // user mouse sensitivity setting.
in_joystick = gEngfuncs.pfnRegisterVariable ( "joystick","0", FCVAR_ARCHIVE );
joy_name = gEngfuncs.pfnRegisterVariable ( "joyname", "joystick", 0 );

View File

@ -280,7 +280,7 @@ void FWGSInput::IN_Shutdown( void )
// Register cvars and reset data
void FWGSInput::IN_Init( void )
{
sensitivity = gEngfuncs.pfnRegisterVariable( "sensitivity", "3", FCVAR_ARCHIVE );
sensitivity = gEngfuncs.pfnRegisterVariable( "sensitivity", "3", FCVAR_ARCHIVE | FCVAR_FILTERSTUFFTEXT );
in_joystick = gEngfuncs.pfnRegisterVariable( "joystick", "0", FCVAR_ARCHIVE );
cl_laddermode = gEngfuncs.pfnRegisterVariable( "cl_laddermode", "2", FCVAR_ARCHIVE );
ac_forwardmove = ac_sidemove = rel_yaw = rel_pitch = 0;

View File

@ -26,6 +26,10 @@
#define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
#define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar
#define FCVAR_PRIVILEGED (1<<10) // Not queryable/settable by unprivileged sources
#define FCVAR_FILTERSTUFFTEXT (1<<11) // Not queryable/settable if unprivileged and filterstufftext is enabled
#define FCVAR_FILTERCHARS (1<<12) // This cvar's string will be filtered for 'bad' characters (e.g. ';', '\n')
#define FCVAR_NOBADPATHS (1<<13) // This cvar's string cannot contain file paths that are above the current directory
typedef struct cvar_s
{