diff options
author | rubidium <rubidium@openttd.org> | 2006-09-09 22:15:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-09-09 22:15:19 +0000 |
commit | 07cbc4f83ae9a2715e411e249a6f36aaf079086e (patch) | |
tree | de8a2ae96faa0b56d51f3ca3093cf8f72d19acfd | |
parent | 6393850dc53e4092a44fefbccd0d267e7afbde02 (diff) | |
download | openttd-07cbc4f83ae9a2715e411e249a6f36aaf079086e.tar.xz |
(svn r6435) -Fix (FS#340): show an error message when executing 'scrollto x' with x < 0 or >= MapSize() instead of asserting later on.
-rw-r--r-- | console_cmds.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/console_cmds.c b/console_cmds.c index 45b678a72..5543ccb8d 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -164,6 +164,10 @@ DEF_CONSOLE_CMD(ConScrollToTile) if (argc == 2) { uint32 result; if (GetArgumentInteger(&result, argv[1])) { + if (result >= MapSize()) { + IConsolePrint(_icolour_err, "Tile does not exist"); + return true; + } ScrollMainWindowToTile((TileIndex)result); return true; } |