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

This commit is contained in:
rubidium 2006-09-09 22:15:19 +00:00
parent 6393850dc5
commit 07cbc4f83a

View File

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