(svn r6435) -Fix (FS#340): show an error message when executing 'scrollto x' with x < 0 or >= MapSize() instead of asserting later on.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 18 years ago
parent 6393850dc5
commit 07cbc4f83a

@ -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;
}

Loading…
Cancel
Save