summaryrefslogtreecommitdiff
path: root/pathfind.c
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-05-03 16:18:45 +0000
committerKUDr <kudr@openttd.org>2006-05-03 16:18:45 +0000
commit758bb8f34be5100a32bb1965d6fd85a799191f7d (patch)
treef5a9b80d3fb903743e3a18a00ebfbf0f27e3fc37 /pathfind.c
parent4ef1033287744611f7e014741ff298b0ef03adf7 (diff)
downloadopenttd-758bb8f34be5100a32bb1965d6fd85a799191f7d.tar.xz
(svn r4715) - Fix: (FS#109) — Wrongfully bad signal - Don't allow OPF to enter train depot from the back
Diffstat (limited to 'pathfind.c')
-rw-r--r--pathfind.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pathfind.c b/pathfind.c
index 3592c372d..4e65c3d99 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 */