summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-06-19 15:48:13 +0000
committerfrosch <frosch@openttd.org>2009-06-19 15:48:13 +0000
commit83f8d52a6770634f503282e4c9407a54f1825255 (patch)
tree3f23a5a8dd6f093b3cfd0c90efb928f33c78ef37 /src
parent6a3a3042838a41575380bcddf11e126d566085cc (diff)
downloadopenttd-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.cpp7
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) {