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 | 8e0855aafd68334f528682bebb7178004131532d (patch) | |
tree | de8a2ae96faa0b56d51f3ca3093cf8f72d19acfd | |
parent | 61bfcc744957708b9c604f5eb0257e1f71b84baf (diff) | |
download | openttd-8e0855aafd68334f528682bebb7178004131532d.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; } |