Fix the behaviour of CVAR_LATCH|CVAR_CHEAT cvars

Fix the output/behaviour of CVAR_CHEAT flagged cvars in case they are
also of type CVAR_LATCH (avoid the early latch case return to make it
work as intended).
This commit is contained in:
IR4T4 2018-04-09 05:08:04 +02:00 committed by Zack Middleton
parent b8ee77cecc
commit 63e59a4591

View file

@ -569,6 +569,12 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
return var; return var;
} }
if ((var->flags & CVAR_CHEAT) && !cvar_cheats->integer)
{
Com_Printf ("%s is cheat protected.\n", var_name);
return var;
}
if (var->flags & CVAR_LATCH) if (var->flags & CVAR_LATCH)
{ {
if (var->latchedString) if (var->latchedString)
@ -589,13 +595,6 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
var->modificationCount++; var->modificationCount++;
return var; return var;
} }
if ( (var->flags & CVAR_CHEAT) && !cvar_cheats->integer )
{
Com_Printf ("%s is cheat protected.\n", var_name);
return var;
}
} }
else else
{ {