From f2ab4c0d0e681d857879f0821ce33b4a1102e9a3 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 15 Mar 2021 03:39:18 +0300 Subject: [PATCH] engine: cfgscript: don't let scr vars overwrite existing variables we don't use them for storing settings anyway only for reference in UI --- engine/common/cfgscript.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/common/cfgscript.c b/engine/common/cfgscript.c index b4efc1fc..3ff96b5e 100644 --- a/engine/common/cfgscript.c +++ b/engine/common/cfgscript.c @@ -292,7 +292,8 @@ int CSCR_WriteGameCVars( file_t *cfg, const char *scriptfilename ) static void CSCR_RegisterVariable( scrvardef_t *var, void *unused ) { - Cvar_Get( var->name, var->value, var->flags|FCVAR_TEMPORARY, var->desc ); + if( !Cvar_FindVar( var->name )) + Cvar_Get( var->name, var->value, var->flags|FCVAR_TEMPORARY, var->desc ); } /*