diff options
author | frosch <frosch@openttd.org> | 2009-06-19 15:48:13 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-06-19 15:48:13 +0000 |
commit | 83f8d52a6770634f503282e4c9407a54f1825255 (patch) | |
tree | 3f23a5a8dd6f093b3cfd0c90efb928f33c78ef37 /src | |
parent | 6a3a3042838a41575380bcddf11e126d566085cc (diff) | |
download | openttd-83f8d52a6770634f503282e4c9407a54f1825255.tar.xz |
(svn r16600) -Fix: Give a more meaningful error message when console commands expect an integer but don't get one.
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 648c4c2fa..54509ac20 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1628,7 +1628,12 @@ void IConsoleSetSetting(const char *name, const char *value) uint32 val; extern bool GetArgumentInteger(uint32 *value, const char *arg); success = GetArgumentInteger(&val, value); - if (success) success = SetSettingValue(index, val); + if (!success) { + IConsolePrintF(CC_ERROR, "'%s' is not an integer.", value); + return; + } + + success = SetSettingValue(index, val); } if (!success) { |