Changeset - r14370:1a48d262054e
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-01-28 19:27:10
yexo@openttd.org
(svn r18937) -Fix (r15190): TileAddWrap didn't return INVALID_TILE for void tiles at the north border
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/map.cpp
Show inline comments
 
@@ -115,9 +115,11 @@ TileIndex TileAddWrap(TileIndex tile, in
 
	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;
 
}
0 comments (0 inline, 0 general)