cvarreset enhancement

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1256 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2005-08-27 04:24:38 +00:00
parent 01d13116a4
commit acf77a47eb
1 changed files with 10 additions and 2 deletions

View File

@ -362,12 +362,13 @@ void Cvar_Reset_f (void)
{
cvar_group_t *grp;
cvar_t *cmd;
int i, listflags;
int i, listflags, exclflags;
char *var;
char *search, *gsearch;
char strtmp[512];
search = gsearch = NULL;
exclflags = 0;
// parse command line options
for (i = 1; i < Cmd_Argc(); i++)
@ -394,12 +395,15 @@ void Cvar_Reset_f (void)
gsearch = Cmd_Argv(i);
break;
case 'u':
exclflags |= CVAR_USERCREATED;
case 'h':
Con_Printf("cvarreset resets all cvars to default values matching given parameters\n"
"Syntax: cvarreset [-a] (-g group)/cvar\n"
"Syntax: cvarreset [-ahu] (-g group)/cvar\n"
" -a matches cvar against alternate cvar names\n"
" -g matches using wildcards in group\n"
" -h shows this help message\n"
" -u excludes user cvars\n"
" cvar indicates the cvars to reset, wildcards (*, ?) accepted\n"
"A -g or cvar is required\n");
return;
@ -441,6 +445,10 @@ void Cvar_Reset_f (void)
if ((cmd->restriction?cmd->restriction:rcon_level.value) > Cmd_ExecLevel)
continue;
// don't reset cvars with matched flags
if (exclflags & cmd->flags)
continue;
// reset only cvars with search substring
if (search)
{