Skip to content

Commit

Permalink
Fix the behaviour of CVAR_LATCH|CVAR_CHEAT cvars
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
IR4T4 authored and zturtleman committed Apr 9, 2018
1 parent b8ee77c commit 63e59a4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions code/qcommon/cvar.c
Expand Up @@ -569,6 +569,12 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
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->latchedString)
Expand All @@ -589,13 +595,6 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
var->modificationCount++;
return var;
}

if ( (var->flags & CVAR_CHEAT) && !cvar_cheats->integer )
{
Com_Printf ("%s is cheat protected.\n", var_name);
return var;
}

}
else
{
Expand Down

0 comments on commit 63e59a4

Please sign in to comment.