Mercurial > hg > openttd
changeset 12187:ab763acb06f6 draft
(svn r16600) -Fix: Give a more meaningful error message when console commands expect an integer but don't get one.
author | frosch <frosch@openttd.org> |
---|---|
date | Fri, 19 Jun 2009 15:48:13 +0000 |
parents | 9ad44e524753 |
children | 225ef26f4d7c |
files | src/settings.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/settings.cpp +++ b/src/settings.cpp @@ -1628,7 +1628,12 @@ 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) {