From 583745769dab302b180493e653a16bc392c80e8b Mon Sep 17 00:00:00 2001 From: "Tony J. White =" Date: Tue, 1 Aug 2006 16:51:13 +0000 Subject: [PATCH] bug 2810 once a latched cvar was changed it could not be reset to its original value --- code/qcommon/cvar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/qcommon/cvar.c b/code/qcommon/cvar.c index a529de6d..d9f9e71e 100644 --- a/code/qcommon/cvar.c +++ b/code/qcommon/cvar.c @@ -331,7 +331,11 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) { value = var->resetString; } - if (!strcmp(value,var->string)) { + if((var->flags & CVAR_LATCH) && var->latchedString) { + if(!strcmp(value,var->latchedString)) + return var; + } + else if (!strcmp(value,var->string)) { return var; } // note what types of cvars have been modified (userinfo, archive, serverinfo, systeminfo)