From 758bb8f34be5100a32bb1965d6fd85a799191f7d Mon Sep 17 00:00:00 2001 From: KUDr Date: Wed, 3 May 2006 16:18:45 +0000 Subject: [PATCH] =?UTF-8?q?(svn=20r4715)=20-=20Fix:=20(FS#109)=20=E2=80=94?= =?UTF-8?q?=20Wrongfully=20bad=20signal=20-=20Don't=20allow=20OPF=20to=20e?= =?UTF-8?q?nter=20train=20depot=20from=20the=20back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pathfind.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pathfind.c b/pathfind.c index 3592c372df..4e65c3d991 100644 --- a/pathfind.c +++ b/pathfind.c @@ -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 @@ static void TPFMode1(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi /* 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 */