summaryrefslogtreecommitdiff
path: root/road_map.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-08-07 06:21:59 +0000
committerpeter1138 <peter1138@openttd.org>2006-08-07 06:21:59 +0000
commit75d7338c315547f9db715ce66f0bc611b152d9be (patch)
tree3e9d27e81a0e26ec8fe7fb67167b3663b4915dd0 /road_map.c
parent5fae4637d87c65095d5ebe72ddcb95c852d44d52 (diff)
downloadopenttd-75d7338c315547f9db715ce66f0bc611b152d9be.tar.xz
(svn r5798) - Fix [r5062]: When expanding a town, the test to check if a tile is a
road depot also excluded all non-road tile types (i.e. bridges/tunnels with road.) Thanks to Graphite for finding this.
Diffstat (limited to 'road_map.c')
-rw-r--r--road_map.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/road_map.c b/road_map.c
index 8702f7692..3573902bf 100644
--- a/road_map.c
+++ b/road_map.c
@@ -52,9 +52,13 @@ RoadBits GetAnyRoadBits(TileIndex tile)
TrackBits GetAnyRoadTrackBits(TileIndex tile)
{
- if (IsTileType(tile, MP_STREET) && !IsTileDepotType(tile, TRANSPORT_ROAD)) {
- uint32 r = GetTileTrackStatus(tile, TRANSPORT_ROAD);
- return (byte)(r | (r >> 8));
+ uint32 r;
+
+ // Don't allow building through road depot tiles.
+ if (IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) {
+ return 0;
}
- return 0;
+
+ r = GetTileTrackStatus(tile, TRANSPORT_ROAD);
+ return (byte)(r | (r >> 8));
}