summaryrefslogtreecommitdiff
path: root/npf.c
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-07-04 15:25:06 +0000
committerhackykid <hackykid@openttd.org>2005-07-04 15:25:06 +0000
commit5fb14350a0d558e79416ebed2ded120c237a06f7 (patch)
tree38d7c8f0c36336e323b4b6ee3472182a26f8b704 /npf.c
parent60ddaf95f0b52a09fad18ea05b2b9db4509d0511 (diff)
downloadopenttd-5fb14350a0d558e79416ebed2ded120c237a06f7.tar.xz
(svn r2517) - Fix: [pbs] Detect end-of-lines properly regarding depots.
Diffstat (limited to 'npf.c')
-rw-r--r--npf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/npf.c b/npf.c
index bdb26af52..85b11bd3f 100644
--- a/npf.c
+++ b/npf.c
@@ -37,8 +37,8 @@ bool IsEndOfLine(TileIndex tile, Trackdir trackdir)
return false;
// depot
- if (IsTileDepotType(tile, TRANSPORT_RAIL))
- return false;
+ if (IsTileDepotType(tile, TRANSPORT_RAIL) && (exitdir != GetDepotDirection(tile, TRANSPORT_RAIL)))
+ return true;
/* Calculate next tile */
dst_tile = tile + TileOffsByDir(exitdir);
@@ -51,14 +51,14 @@ bool IsEndOfLine(TileIndex tile, Trackdir trackdir)
{
byte src_type = GetTileRailType(tile, trackdir);
- byte dst_type = GetTileRailType(dst_tile, TrackdirToExitdir(trackdir));
+ byte dst_type = GetTileRailType(dst_tile, exitdir);
if (src_type != dst_type) {
return true;
}
if (GetTileOwner(tile) != GetTileOwner(dst_tile))
return true;
- if (IsTileDepotType(dst_tile, TRANSPORT_RAIL) && (TrackdirToExitdir(trackdir) != ReverseDiagdir(GetDepotDirection(dst_tile, TRANSPORT_RAIL))))
+ if (IsTileDepotType(dst_tile, TRANSPORT_RAIL) && (exitdir != ReverseDiagdir(GetDepotDirection(dst_tile, TRANSPORT_RAIL))))
return true;
/* Check for oneway signal against us */