mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: add filterable flag support for cvars and cmds
This commit is contained in:
@@ -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] ))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user