(svn r4715) - Fix: (FS#109) ? Wrongfully bad signal - Don't allow OPF to enter train depot from the back
authorKUDr
Wed, 03 May 2006 16:18:45 +0000
changeset 3735 56a5bdee6c9a
parent 3734 f929883c5ae0
child 3736 79ea938e713b
(svn r4715) - Fix: (FS#109) ? Wrongfully bad signal - Don't allow OPF to enter train depot from the back
pathfind.c
--- a/pathfind.c	Wed May 03 15:46:21 2006 +0000
+++ b/pathfind.c	Wed May 03 16:18:45 2006 +0000
@@ -11,6 +11,7 @@
 #include "debug.h"
 #include "tunnel_map.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)
@@ -264,6 +265,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) && GetRailDepotDirection(tile) == 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 */