diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index 362b23e9..9adbf70c 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -51,7 +51,11 @@ void CoreConfig::OnRootConsoleCommand(const char *command, unsigned int argcount if (err == ConfigResult_Reject) { - g_Logger.LogError("Could not set config option \"%s\" to \"%s\" (error: %s)", option, value, error); + g_RootMenu.ConsolePrint("Could not set config option \"%s\" to \"%s\" (%s)", option, value, error); + } else if (err == ConfigResult_Ignore) { + g_RootMenu.ConsolePrint("No such config option \"%s\" exists.", option); + } else { + g_RootMenu.ConsolePrint("Config option \"%s\" successfully set to \"%s.\"", option, value); } return; @@ -81,7 +85,7 @@ void CoreConfig::Initialize() if ((err=g_TextParser.ParseFile_SMC(filePath, this, NULL, NULL)) != SMCParse_Okay) { - /* :TODO: This won't actually log or print anything :( - So fix that somehow */ + /* :TODO: This won't actually log or print anything :( - So fix that somehow */ const char *error = g_TextParser.GetSMCErrorString(err); g_Logger.LogFatal("[SM] Error encountered parsing core config file: %s", error ? error : ""); } @@ -95,7 +99,7 @@ SMCParseResult CoreConfig::ReadSMC_KeyValue(const char *key, const char *value, if (err == ConfigResult_Reject) { /* This is a fatal error */ - g_Logger.LogFatal("%s", error); + g_Logger.LogFatal("Config error (key: %s) (value: %s) %s", key, value, error); } return SMCParse_Continue; diff --git a/core/Logger.cpp b/core/Logger.cpp index 15a5fb94..36b5246b 100644 --- a/core/Logger.cpp +++ b/core/Logger.cpp @@ -427,6 +427,11 @@ void Logger::DisableLogging() void Logger::LogFatal(const char *msg, ...) { + /* :TODO: make this print all pretty-like + * In fact, the pretty log printing function should be abstracted. + * It's already implemented twice which is bad. + */ + char path[PLATFORM_MAX_PATH]; g_SourceMod.BuildPath(Path_Game, path, sizeof(path), "sourcemod_fatal.log"); FILE *fp = fopen(path, "at"); diff --git a/core/Translator.cpp b/core/Translator.cpp index e6b7455f..e47093d5 100644 --- a/core/Translator.cpp +++ b/core/Translator.cpp @@ -610,7 +610,7 @@ ConfigResult Translator::OnSourceModConfigChanged(const char *key, char *error, size_t maxlength) { - if (strcasecmp(value, "ServerLang") == 0) + if (strcasecmp(key, "ServerLang") == 0) { if (source == ConfigSource_Console) { diff --git a/core/sourcemod.cpp b/core/sourcemod.cpp index 73d234c3..10f8ef5c 100644 --- a/core/sourcemod.cpp +++ b/core/sourcemod.cpp @@ -75,7 +75,7 @@ ConfigResult SourceModBase::OnSourceModConfigChanged(const char *key, char *error, size_t maxlength) { - if (strcasecmp(value, "BasePath") == 0) + if (strcasecmp(key, "BasePath") == 0) { if (source == ConfigSource_Console) {