diff options
author | celestar <celestar@openttd.org> | 2006-04-12 12:12:51 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-04-12 12:12:51 +0000 |
commit | c08ed855f373b4aaa5d87632207feadead92799f (patch) | |
tree | a4cd8f9d6569c2667208b9e1f1dc748a188f0283 | |
parent | ee7eaef29d5c65a3e4c5ae317c0c2dd3ebe9651f (diff) | |
download | openttd-c08ed855f373b4aaa5d87632207feadead92799f.tar.xz |
(svn r4380) -Codechange: Make use of GetTrackBits where appropriate
-rw-r--r-- | rail_cmd.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 407b8a687..a150286b1 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -1781,11 +1781,12 @@ static void TileLoop_Track(TileIndex tile) (rail & TRACK_BIT_X) )) { TileIndex n = tile + TileDiffXY(0, -1); + TrackBits nrail = GetTrackBits(n); if (!IsTileType(n, MP_RAILWAY) || !IsTileOwner(n, owner) || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_UPPER || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LEFT) { + nrail == TRACK_BIT_UPPER || + nrail == TRACK_BIT_LEFT) { new_ground = RAIL_GROUND_FENCE_NW; } } @@ -1795,11 +1796,12 @@ static void TileLoop_Track(TileIndex tile) (rail & TRACK_BIT_X) )) { TileIndex n = tile + TileDiffXY(0, 1); + TrackBits nrail = GetTrackBits(n); if (!IsTileType(n, MP_RAILWAY) || !IsTileOwner(n, owner) || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LOWER || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_RIGHT) { + nrail == TRACK_BIT_LOWER || + nrail == TRACK_BIT_RIGHT) { new_ground = (new_ground == RAIL_GROUND_FENCE_NW) ? RAIL_GROUND_FENCE_SENW : RAIL_GROUND_FENCE_SE; } @@ -1810,11 +1812,12 @@ static void TileLoop_Track(TileIndex tile) (rail & TRACK_BIT_Y) )) { TileIndex n = tile + TileDiffXY(-1, 0); + TrackBits nrail = GetTrackBits(n); if (!IsTileType(n, MP_RAILWAY) || !IsTileOwner(n, owner) || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_UPPER || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_RIGHT) { + nrail == TRACK_BIT_UPPER || + nrail == TRACK_BIT_RIGHT) { new_ground = RAIL_GROUND_FENCE_NE; } } @@ -1824,11 +1827,12 @@ static void TileLoop_Track(TileIndex tile) (rail & TRACK_BIT_Y) )) { TileIndex n = tile + TileDiffXY(1, 0); + TrackBits nrail = GetTrackBits(n); if (!IsTileType(n, MP_RAILWAY) || !IsTileOwner(n, owner) || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LOWER || - (_m[n].m5 & TRACK_BIT_MASK) == TRACK_BIT_LEFT) { + nrail == TRACK_BIT_LOWER || + nrail == TRACK_BIT_LEFT) { new_ground = (new_ground == RAIL_GROUND_FENCE_NE) ? RAIL_GROUND_FENCE_NESW : RAIL_GROUND_FENCE_SW; } |