mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r10519) -Fix: when getting a "nearby" tile, make sure you never roam outside of the map.
This commit is contained in:
parent
9dee540233
commit
de084ace1c
|
@ -265,5 +265,6 @@ TileIndex GetNearbyTile(byte parameter, TileIndex tile)
|
|||
if (x >= 8) x -= 16;
|
||||
if (y >= 8) y -= 16;
|
||||
|
||||
return tile + TileDiffXY(x, y);
|
||||
/* Make sure we never roam outside of the map */
|
||||
return TILE_MASK(tile + TileDiffXY(x, y));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue