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:
parent
1a09f2b6df
commit
fc504737c5
@ -195,16 +195,17 @@ void CoreConfig::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *c
|
|||||||
const char *value = command->Arg(3);
|
const char *value = command->Arg(3);
|
||||||
|
|
||||||
char error[255];
|
char error[255];
|
||||||
|
|
||||||
ConfigResult res = SetConfigOption(option, value, ConfigSource_Console, error, sizeof(error));
|
ConfigResult res = SetConfigOption(option, value, ConfigSource_Console, error, sizeof(error));
|
||||||
|
|
||||||
if (res == ConfigResult_Reject)
|
if (res == ConfigResult_Reject)
|
||||||
{
|
{
|
||||||
UTIL_ConsolePrint("[SM] Could not set config option \"%s\" to \"%s\". (%s)", option, value, error);
|
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 {
|
} 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;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user