mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +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) {
|
if (argc == 2) {
|
||||||
uint32 result;
|
uint32 result;
|
||||||
if (GetArgumentInteger(&result, argv[1])) {
|
if (GetArgumentInteger(&result, argv[1])) {
|
||||||
|
if (result >= MapSize()) {
|
||||||
|
IConsolePrint(_icolour_err, "Tile does not exist");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ScrollMainWindowToTile((TileIndex)result);
|
ScrollMainWindowToTile((TileIndex)result);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user