diff options
author | truelight <truelight@openttd.org> | 2005-11-16 14:41:01 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-11-16 14:41:01 +0000 |
commit | c1b012171d2a0db4702af7f2b1616a2139e98dcd (patch) | |
tree | 214102297a7345bf5d6cf0849e439481b6c5fb1a /pbs.c | |
parent | b739674307ee32880100387e8b05d7307f4a696f (diff) | |
download | openttd-c1b012171d2a0db4702af7f2b1616a2139e98dcd.tar.xz |
(svn r3210) -Codechange: use IsRailWaypoint where possible (instead of magicnumbers)
-Codechange: IsRailWaypoint should take 'tile', not 'm5'
Diffstat (limited to 'pbs.c')
-rw-r--r-- | pbs.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -10,6 +10,7 @@ #include "npf.h" #include "pathfind.h" #include "depot.h" +#include "waypoint.h" /** @file pbs.c Path-Based-Signalling implementation file * @see pbs.h */ @@ -52,7 +53,7 @@ void PBSReserveTrack(TileIndex tile, Track track) { assert(track <= 5); switch (GetTileType(tile)) { case MP_RAILWAY: - if ((_m[tile].m5 & ~1) == 0xC4) { + if (IsRailWaypoint(tile)) { // waypoint SETBIT(_m[tile].m3, 6); } else { @@ -90,7 +91,7 @@ byte PBSTileReserved(TileIndex tile) { assert(IsValidTile(tile)); switch (GetTileType(tile)) { case MP_RAILWAY: - if ((_m[tile].m5 & ~1) == 0xC4) { + if (IsRailWaypoint(tile)) { // waypoint // check if its reserved if (!HASBIT(_m[tile].m3, 6)) return 0; @@ -125,7 +126,7 @@ uint16 PBSTileUnavail(TileIndex tile) { assert(IsValidTile(tile)); switch (GetTileType(tile)) { case MP_RAILWAY: - if ((_m[tile].m5 & ~1) == 0xC4) { + if (IsRailWaypoint(tile)) { // waypoint return HASBIT(_m[tile].m3, 6) ? TRACKDIR_BIT_MASK : 0; } else { @@ -153,7 +154,7 @@ void PBSClearTrack(TileIndex tile, Track track) { assert(track <= 5); switch (GetTileType(tile)) { case MP_RAILWAY: - if ((_m[tile].m5 & ~1) == 0xC4) { + if (IsRailWaypoint(tile)) { // waypoint CLRBIT(_m[tile].m3, 6); } else { |