Merge pull request #72 from GoDhAnD-897/config-cvars-fix

Fixed cvar values from yapb.cfg being ignored after initialization
This commit is contained in:
jeefo 2019-01-06 12:37:53 +03:00 committed by GitHub
commit d4dd4110b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -504,9 +504,8 @@ void execBotConfigs (bool onlyMain) {
if (cvar != nullptr) { if (cvar != nullptr) {
auto value = const_cast <char *> (keyval[1].trim ().trim ("\"").trim ().chars ()); auto value = const_cast <char *> (keyval[1].trim ().trim ("\"").trim ().chars ());
if (needsToIgnoreVar (ignore, key)) { if (needsToIgnoreVar (ignore, key) && !!stricmp (value, cvar->string)) {
if (!!stricmp (value, cvar->string)) { engine.print ("Bot CVAR '%s' differs from the stored in the config (%s/%s). Ignoring.", cvar->name, cvar->string, value);
engine.print ("Bot CVAR '%s' is differs from stored in config (%s/%s). Ignoring.", cvar->name, cvar->string, value);
// ensure cvar will have old value // ensure cvar will have old value
g_engfuncs.pfnCvar_DirectSet (cvar, cvar->string); g_engfuncs.pfnCvar_DirectSet (cvar, cvar->string);
@ -515,7 +514,6 @@ void execBotConfigs (bool onlyMain) {
g_engfuncs.pfnCvar_DirectSet (cvar, value); g_engfuncs.pfnCvar_DirectSet (cvar, value);
} }
} }
}
else else
engine.execCmd (lineBuffer); engine.execCmd (lineBuffer);
} }