Properly say when a cvar is a cheat

This commit is contained in:
Sally Coolatta 2022-09-27 14:25:08 -04:00
parent 90578b2628
commit 562f5398a0
2 changed files with 8 additions and 4 deletions

View file

@ -1599,8 +1599,13 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
if ((var->flags & CV_CHEAT) && CV_CheatsEnabled() == false)
{
// Enforce to default value without cheats.
overridestr = var->defaultvalue;
valstr = overridestr;
if (stricmp(var->defaultvalue, valstr) != 0)
{
// Warn the user about this.
CONS_Printf("This cannot be used without cheats enabled.\n");
}
valstr = overridestr = var->defaultvalue;
}
if (CV_CompleteValue(var, &overridestr, &overrideval))

View file

@ -5621,8 +5621,7 @@ static void Command_KartGiveItem_f(void)
}
else
{
CONS_Alert(CONS_NOTICE,
"The server does not allow this.\n");
CONS_Printf("This cannot be used without cheats enabled.\n");
}
}