From 07cbc4f83ae9a2715e411e249a6f36aaf079086e Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 9 Sep 2006 22:15:19 +0000 Subject: (svn r6435) -Fix (FS#340): show an error message when executing 'scrollto x' with x < 0 or >= MapSize() instead of asserting later on. --- console_cmds.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- cgit v1.2.3-70-g09d2