Fix core config values not being cached (#673)

Valid core config options aren't cached to be retrieved using `GetCoreConfigValue` after they've been loaded from core.cfg or set through the `sm config` root console menu.

E.g. `sm config ServerLang` would return `[SM] No such config option "ServerLang" exists.` all the time.

Stop notifying other listeners if the config key was consumed, but don't skip adding it to the cache.

Also fix `FollowCSGOServerGuidelines` always showing as unhandled command when being changed through `sm config FollowCSGOServerGuidelines yes`.
This commit is contained in:
peace-maker
2017-09-23 17:24:39 -07:00
committed by Kyle Sanderson
parent 54565c92f7
commit 7e898ee530
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -171,13 +171,16 @@ ConfigResult CHalfLife2::OnSourceModConfigChanged(const char *key, const char *v
if (strcasecmp(value, "no") == 0)
{
m_bFollowCSGOServerGuidelines = false;
return ConfigResult_Accept;
}
else if (strcasecmp(value, "yes") == 0)
{
m_bFollowCSGOServerGuidelines = true;
return ConfigResult_Accept;
}
else
{
ke::SafeSprintf(error, maxlength, "Invalid value: must be \"yes\" or \"no\"");
return ConfigResult_Reject;
}
#endif