mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(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 (x >= 8) x -= 16;
|
||||||
if (y >= 8) y -= 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
Block a user