mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(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:
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…
Reference in New Issue
Block a user