summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-09-23 17:37:21 +0000
committerhackykid <hackykid@openttd.org>2005-09-23 17:37:21 +0000
commitd5d8d29c9f48545ea6e8bec0fdd7433a280dab0c (patch)
treec232be53eb635f4902fc147dbc76854e773944dd
parent35ce780bb6df5135da977ce78f898d17233f3d47 (diff)
downloadopenttd-d5d8d29c9f48545ea6e8bec0fdd7433a280dab0c.tar.xz
(svn r2977) - CodeChange: [pbs] Use a check to see if a rail segment is a pbs segment, instead of letting the pathfinder determine this.
-rw-r--r--train_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 3bde7c07d..3fad0435a 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2746,7 +2746,7 @@ static void TrainController(Vehicle *v)
trackdir = TrackEnterdirToTrackdir(FIND_FIRST_BIT(chosen_track), enterdir);
assert(trackdir != 0xff);
- if (PBSIsPbsSignal(gp.new_tile,trackdir)) {
+ if (PBSIsPbsSignal(gp.new_tile,trackdir) && PBSIsPbsSegment(gp.new_tile,trackdir)) {
// encountered a pbs signal, and possible a pbs block
DEBUG(pbs, 3) ("pbs: (%i) arrive AT signal, tile:%x pbs_stat:%i",v->unitnumber, gp.new_tile, v->u.rail.pbs_status);
@@ -3184,7 +3184,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
if (v->u.rail.pbs_status == PBS_STAT_HAS_PATH)
return true;
- if ((trackdir != INVALID_TRACKDIR) && (PBSIsPbsSignal(tile,trackdir)) && !(IsTileType(v->tile, MP_STATION) && (v->current_order.station == _m[v->tile].m2))) {
+ if ((trackdir != INVALID_TRACKDIR) && (PBSIsPbsSignal(tile,trackdir) && PBSIsPbsSegment(tile,trackdir)) && !(IsTileType(v->tile, MP_STATION) && (v->current_order.station == _m[v->tile].m2))) {
NPFFindStationOrTileData fstd;
NPFFoundTargetData ftd;