Mercurial > hg > openttd
changeset 14380:95da7391b13e draft
(svn r18937) -Fix (r15190): TileAddWrap didn't return INVALID_TILE for void tiles at the north border
author | yexo <yexo@openttd.org> |
---|---|
date | Thu, 28 Jan 2010 19:27:10 +0000 |
parents | 18378caba436 |
children | a5ea8b661d29 |
files | src/map.cpp |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/map.cpp +++ b/src/map.cpp @@ -115,9 +115,11 @@ uint x = TileX(tile) + addx; uint y = TileY(tile) + addy; + /* Disallow void tiles at the north border. */ + if (_settings_game.construction.freeform_edges && (x == 0 || y == 0)) return INVALID_TILE; + /* Are we about to wrap? */ - if (x < MapMaxX() && y < MapMaxY()) - return tile + TileDiffXY(addx, addy); + if (x < MapMaxX() && y < MapMaxY()) return tile + TileDiffXY(addx, addy); return INVALID_TILE; }