engine: add filterable flag support for cvars and cmds

This commit is contained in:
Alibek Omarov 2021-11-03 23:06:51 +06:00 committed by a1batross
parent a3d6e7bcfe
commit 8599119c8d
2 changed files with 8 additions and 2 deletions

View File

@ -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] ))

View File

@ -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;
}