forked from mirror/OpenTTD
(svn r10686) -Fix [FS#1058]: determining whether there is a tunnel going under the lowered area is only needed in two directions instead of all four, so take the directions (one for each axis) to the nearest border (along the given axis). Furthermore GetTileZ did much more than absolutely necessary.
This commit is contained in:
@@ -64,8 +64,6 @@ bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
|
||||
bool IsTunnelInWay(TileIndex tile, uint z)
|
||||
{
|
||||
return
|
||||
IsTunnelInWayDir(tile, z, DIAGDIR_NE) ||
|
||||
IsTunnelInWayDir(tile, z, DIAGDIR_SE) ||
|
||||
IsTunnelInWayDir(tile, z, DIAGDIR_SW) ||
|
||||
IsTunnelInWayDir(tile, z, DIAGDIR_NW);
|
||||
IsTunnelInWayDir(tile, z, (TileX(tile) > (MapMaxX() / 2)) ? DIAGDIR_NE : DIAGDIR_SW) ||
|
||||
IsTunnelInWayDir(tile, z, (TileY(tile) > (MapMaxY() / 2)) ? DIAGDIR_NW : DIAGDIR_SE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user