From fcb0f7c1ad7cd118cc797f8bf31d77d6877bb360 Mon Sep 17 00:00:00 2001 From: GoDhAnD-897 Date: Thu, 3 Jan 2019 17:09:52 +0100 Subject: [PATCH] Fixed cvar values from yapb.cfg being ignored after initialization --- source/interface.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/source/interface.cpp b/source/interface.cpp index 4296b56..d11a994 100644 --- a/source/interface.cpp +++ b/source/interface.cpp @@ -504,16 +504,14 @@ void execBotConfigs (bool onlyMain) { if (cvar != nullptr) { auto value = const_cast (keyval[1].trim ().trim ("\"").trim ().chars ()); - if (needsToIgnoreVar (ignore, key)) { - if (!!stricmp (value, cvar->string)) { - engine.print ("Bot CVAR '%s' is differs from stored in config (%s/%s). Ignoring.", cvar->name, cvar->string, value); + if (needsToIgnoreVar (ignore, key) && !!stricmp (value, cvar->string)) { + engine.print ("Bot CVAR '%s' differs from the stored in the config (%s/%s). Ignoring.", cvar->name, cvar->string, value); - // ensure cvar will have old value - g_engfuncs.pfnCvar_DirectSet (cvar, cvar->string); - } - else { - g_engfuncs.pfnCvar_DirectSet (cvar, value); - } + // ensure cvar will have old value + g_engfuncs.pfnCvar_DirectSet (cvar, cvar->string); + } + else { + g_engfuncs.pfnCvar_DirectSet (cvar, value); } } else