From 63e59a4591639625fc15efb0588e0a8776d9fb1d Mon Sep 17 00:00:00 2001 From: IR4T4 Date: Mon, 9 Apr 2018 05:08:04 +0200 Subject: [PATCH] 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). --- code/qcommon/cvar.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/qcommon/cvar.c b/code/qcommon/cvar.c index 5a0e6906..7b219f8d 100644 --- a/code/qcommon/cvar.c +++ b/code/qcommon/cvar.c @@ -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) @@ -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 {