changeset 2009:6571069a6a78 draft

(svn r2517) - Fix: [pbs] Detect end-of-lines properly regarding depots.
author hackykid <hackykid@openttd.org>
date Mon, 04 Jul 2005 15:25:06 +0000
parents 9e0f41852bf8
children 6737403e44cd
files npf.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/npf.c
+++ b/npf.c
@@ -37,8 +37,8 @@
 		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 @@
 
 	{
 		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 */