Browse Source

engine: add filterable flag support for cvars and cmds

pull/2/head
Alibek Omarov 3 years ago committed by a1batross
parent
commit
8599119c8d
  1. 3
      engine/common/cmd.c
  2. 7
      engine/common/cvar.c

3
engine/common/cmd.c

@ -952,6 +952,9 @@ static qboolean Cmd_ShouldAllowCommand( cmd_t *cmd, qboolean isPrivileged ) @@ -952,6 +952,9 @@ static qboolean Cmd_ShouldAllowCommand( cmd_t *cmd, qboolean isPrivileged )
if( cl_filterstuffcmd.value <= 0.0f )
return true;
if( FBitSet( cmd->flags, CMD_FILTERABLE ))
return false;
for( i = 0; i < ARRAYSIZE( prefixes ); i++ )
{
if( !Q_stricmp( cmd->name, prefixes[i] ))

7
engine/common/cvar.c

@ -769,15 +769,18 @@ static qboolean Cvar_ShouldSetCvar( convar_t *v, qboolean isPrivileged ) @@ -769,15 +769,18 @@ static qboolean Cvar_ShouldSetCvar( convar_t *v, qboolean isPrivileged )
if( isPrivileged )
return true;
if( v->flags & FCVAR_PRIVILEGED )
if( FBitSet( v->flags, FCVAR_PRIVILEGED ))
return false;
if( cl_filterstuffcmd.value <= 0.0f )
return true;
if( FBitSet( v->flags, FCVAR_FILTERABLE ))
return false;
for( i = 0; i < ARRAYSIZE( prefixes ); i++ )
{
if( Q_stricmp( v->name, prefixes[i] ))
if( !Q_stricmp( v->name, prefixes[i] ))
return false;
}

Loading…
Cancel
Save