rename reset command to resetcvar and do not create a new CVAR

This commit is contained in:
Alexander Kromm 2020-10-15 01:04:04 +07:00 committed by Christoph Oelckers
parent 18a8fafd7d
commit 92d68d05db

View file

@ -1497,18 +1497,16 @@ CCMD (unset)
} }
} }
CCMD (reset) CCMD (resetcvar)
{ {
if (argv.argc() != 2) if (argv.argc() != 2)
{ {
Printf ("usage: reset <variable>\n"); Printf ("usage: resetcvar <variable>\n");
} }
else else
{ {
FBaseCVar *var = FindCVar (argv[1], NULL); FBaseCVar *var = FindCVar (argv[1], NULL);
if (var == NULL) if (var != NULL)
var = new FStringCVar (argv[1], NULL, CVAR_AUTO | CVAR_UNSETTABLE | cvar_defflags);
var->ResetToDefault(); var->ResetToDefault();
} }
} }