summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--console_cmds.c4
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;
}