summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-23 07:31:36 +0000
committertron <tron@openttd.org>2006-02-23 07:31:36 +0000
commit6f719ec50a270a3f7ea90b1c8b10cea4b22f13a8 (patch)
tree7025dec1d8548effaba144c23e4c8e62a9ea61f3 /road_cmd.c
parentce714155840aa03fcf0706d1dac18a917f874c3a (diff)
downloadopenttd-6f719ec50a270a3f7ea90b1c8b10cea4b22f13a8.tar.xz
(svn r3656) Simplify the overly complicated check for road pieces under a bridge
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 5d490a040..a8fcda2e1 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -48,10 +48,10 @@ static bool HasTileRoadAt(TileIndex tile, int i)
(~(_m[tile].m5 - 0x43) & 3) == i;
case MP_TUNNELBRIDGE:
- mask = GetRoadBitsByTile(tile);
- b = 10; if (mask & 1) break;
- b = 5; if (mask & 2) break;
- return false;
+ // bail out, if not a bridge middle part with road underneath
+ if ((_m[tile].m5 & 0xF8) != 0xE8) return false;
+ // road direction perpendicular to bridge
+ b = (_m[tile].m5 & 0x01) ? 10 : 5;
default:
return false;