From fc504737c5fe30e446b82339acb87f13c2925363 Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Fri, 30 Oct 2015 11:06:54 +0000 Subject: [PATCH] Fix a misleading error message from "sm config". The Ignore state could be hit if the value was read directly rather than using OnSourceModConfigChanged. --- core/CoreConfig.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index b4193997..dd97425b 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -195,16 +195,17 @@ void CoreConfig::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *c const char *value = command->Arg(3); char error[255]; - ConfigResult res = SetConfigOption(option, value, ConfigSource_Console, error, sizeof(error)); if (res == ConfigResult_Reject) { UTIL_ConsolePrint("[SM] Could not set config option \"%s\" to \"%s\". (%s)", option, value, error); - } else if (res == ConfigResult_Ignore) { - UTIL_ConsolePrint("[SM] No such config option \"%s\" exists.", option); } else { - UTIL_ConsolePrint("[SM] Config option \"%s\" successfully set to \"%s\".", option, value); + if (res == ConfigResult_Ignore) { + UTIL_ConsolePrint("[SM] WARNING: Config option \"%s\" is not registered.", option); + } + + UTIL_ConsolePrint("[SM] Config option \"%s\" set to \"%s\".", option, value); } return;