(svn r12170) -Fix: do not draw trees along road and street lights under low bridges (spotted by _minime_)

This commit is contained in:
smatz
2008-02-17 21:27:44 +00:00
parent 6bf44158c5
commit d75cccf5d5
2 changed files with 16 additions and 0 deletions

View File

@@ -663,10 +663,16 @@ static CommandCost DoClearBridge(TileIndex tile, uint32 flags)
/* read this value before actual removal of bridge */
bool rail = GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL;
Owner owner = GetTileOwner(tile);
uint height = GetBridgeHeight(tile);
DoClearSquare(tile);
DoClearSquare(endtile);
for (TileIndex c = tile + delta; c != endtile; c += delta) {
/* do not let trees appear from 'nowhere' after removing bridge */
if (IsNormalRoadTile(c) && GetRoadside(c) == ROADSIDE_TREES) {
uint minz = GetTileMaxZ(c) + 3 * TILE_HEIGHT;
if (height < minz) SetRoadside(c, ROADSIDE_PAVED);
}
ClearBridgeMiddle(c);
MarkTileDirtyByTile(c);
}