summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-01-07 17:26:37 +0000
committertron <tron@openttd.org>2006-01-07 17:26:37 +0000
commitde34ab97a2f91740815d9657f785b71194742552 (patch)
tree99d67db42bab9fdbaca7694e7319a0a3a8940c2e
parente81c316134b1aba5dfab9cb4e6bc09ad3f49878e (diff)
downloadopenttd-de34ab97a2f91740815d9657f785b71194742552.tar.xz
(svn r3389) -Fix: No fence was placed when placing fences and the neighbouring tile is a rail configuration which permits a fence but has a signal
(Per request of peter1138 the above line does not contain any commas)
-rw-r--r--rail_cmd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index ecc8e6ca0..91ba791b1 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1996,8 +1996,8 @@ static void TileLoop_Track(TileIndex tile)
if (!IsTileType(n, MP_RAILWAY) ||
!IsTileOwner(n, owner) ||
- _m[n].m5 == TRACK_BIT_UPPER ||
- _m[n].m5 == TRACK_BIT_LEFT) {
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_UPPER ||
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LEFT) {
new_ground = RAIL_GROUND_FENCE_NW;
}
}
@@ -2010,8 +2010,8 @@ static void TileLoop_Track(TileIndex tile)
if (!IsTileType(n, MP_RAILWAY) ||
!IsTileOwner(n, owner) ||
- _m[n].m5 == TRACK_BIT_LOWER ||
- _m[n].m5 == TRACK_BIT_RIGHT) {
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LOWER ||
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_RIGHT) {
new_ground = (new_ground == RAIL_GROUND_FENCE_NW) ?
RAIL_GROUND_FENCE_SENW : RAIL_GROUND_FENCE_SE;
}
@@ -2025,8 +2025,8 @@ static void TileLoop_Track(TileIndex tile)
if (!IsTileType(n, MP_RAILWAY) ||
!IsTileOwner(n, owner) ||
- _m[n].m5 == TRACK_BIT_UPPER ||
- _m[n].m5 == TRACK_BIT_RIGHT) {
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_UPPER ||
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_RIGHT) {
new_ground = RAIL_GROUND_FENCE_NE;
}
}
@@ -2039,8 +2039,8 @@ static void TileLoop_Track(TileIndex tile)
if (!IsTileType(n, MP_RAILWAY) ||
!IsTileOwner(n, owner) ||
- _m[n].m5 == TRACK_BIT_LOWER ||
- _m[n].m5 == TRACK_BIT_LEFT) {
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LOWER ||
+ (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LEFT) {
new_ground = (new_ground == RAIL_GROUND_FENCE_NE) ?
RAIL_GROUND_FENCE_NESW : RAIL_GROUND_FENCE_SW;
}