(svn r4718) - Backport from trunk (r4715): 0.4
authorDarkvater
Wed, 03 May 2006 20:25:10 +0000
branch0.4
changeset 10005 fb5d623e692c
parent 10004 0b8b1b4b2c30
child 10006 9981b098f137
(svn r4718) - Backport from trunk (r4715):
Fix: Don't allow PF to enter train depot from the back (signal updates)
pathfind.c
--- a/pathfind.c	Wed May 03 20:09:28 2006 +0000
+++ b/pathfind.c	Wed May 03 20:25:10 2006 +0000
@@ -9,6 +9,7 @@
 #include "rail.h"
 #include "debug.h"
 #include "variables.h"
+#include "depot.h"
 
 // remember which tiles we have already visited so we don't visit them again.
 static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir)
@@ -293,6 +294,9 @@
 
 	/* Check in case of rail if the owner is the same */
 	if (tpf->tracktype == TRANSPORT_RAIL) {
+		// don't enter train depot from the back
+		if (IsTileDepotType(tile, TRANSPORT_RAIL) && GB(_m[tile].m5, 0, 2) == direction) return;
+
 		if (IsTileType(tile_org, MP_RAILWAY) || IsTileType(tile_org, MP_STATION) || IsTileType(tile_org, MP_TUNNELBRIDGE))
 			if (IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_STATION) || IsTileType(tile, MP_TUNNELBRIDGE))
 				/* Check if we are on a bridge (middle parts don't have an owner */