summaryrefslogtreecommitdiff
path: root/pbs.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-16 14:41:01 +0000
committertruelight <truelight@openttd.org>2005-11-16 14:41:01 +0000
commitcd1ad247231e98e83298943ac661af0990058cf9 (patch)
tree214102297a7345bf5d6cf0849e439481b6c5fb1a /pbs.c
parenta56ffc6a0fe807ff59c4b48e1837257761f6cfab (diff)
downloadopenttd-cd1ad247231e98e83298943ac661af0990058cf9.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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pbs.c b/pbs.c
index 701219529..e18b0acf8 100644
--- a/pbs.c
+++ b/pbs.c
@@ -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 {