Fix a misleading error message from "sm config".

The Ignore state could be hit if the value was read directly rather than using OnSourceModConfigChanged.
This commit is contained in:
Asher Baker 2015-10-30 11:06:54 +00:00
parent 1a09f2b6df
commit fc504737c5

View File

@ -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;