summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-14 08:09:57 +0000
committertron <tron@openttd.org>2005-11-14 08:09:57 +0000
commit833032adc09ce95c68d4a4b412221a0b3f88e670 (patch)
tree80b15078ff5a1c09815ccb23f4c9e7629774dae4 /tunnelbridge_cmd.c
parent357aba747578ecd3b8cc1a29bc740634211ada37 (diff)
downloadopenttd-833032adc09ce95c68d4a4b412221a0b3f88e670.tar.xz
(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index d5b1fea4d..6ad1f79f7 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -813,7 +813,7 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags)
static const uint16 _new_data_table[] = {0x1002, 0x1001, 0x2005, 0x200A, 0, 0, 0, 0};
new_data = _new_data_table[((m5 & 0x18) >> 2) | (m5&1)];
} else {
- if (!(m5 & 0x18)) goto clear_it;
+ if (GB(m5, 3, 2) == 0) goto clear_it;
new_data = (GetTileSlope(c, NULL) == 0) ? 0x6000 : 0x6001;
}
@@ -1398,14 +1398,14 @@ static uint32 GetTileTrackStatus_TunnelBridge(TileIndex tile, TransportType mode
if ((m5 & 0xF0) == 0) {
/* This is a tunnel */
- if (((m5 & 0xCU) >> 2) == mode) {
+ if (GB(m5, 2, 2) == mode) {
/* Tranport in the tunnel is compatible */
return m5&1 ? 0x202 : 0x101;
}
} else if (m5 & 0x80) {
/* This is a bridge */
result = 0;
- if (((m5 & 0x6U) >> 1) == mode) {
+ if (GB(m5, 1, 2) == mode) {
/* Transport over the bridge is compatible */
result = m5&1 ? 0x202 : 0x101;
}
@@ -1421,7 +1421,7 @@ static uint32 GetTileTrackStatus_TunnelBridge(TileIndex tile, TransportType mode
return result;
} else {
/* Transport underneath */
- if ((m5 & 0x18U) >> 3 != mode)
+ if (GB(m5, 3, 2) != mode)
/* Incompatible transport underneath */
return result;
}