summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-12-29 18:40:02 +0000
committerKUDr <kudr@openttd.org>2006-12-29 18:40:02 +0000
commit62f55edbe74be0a43f946d45458ff179e2645220 (patch)
treea4c7e6b2dc2e555be8bb3761df20a7646dd94bd1
parent55e785d038e1f70dbd5cc36cc67a9d31350f06e7 (diff)
downloadopenttd-62f55edbe74be0a43f946d45458ff179e2645220.tar.xz
(svn r7623) - Fix: [YAPF] trains/roadvehs trying to enter the bridge ramp from under bridge rail/road (introduced by bridge merge r7573)
-rw-r--r--yapf/follow_track.hpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/yapf/follow_track.hpp b/yapf/follow_track.hpp
index 7c37b50bb..7864dc5e5 100644
--- a/yapf/follow_track.hpp
+++ b/yapf/follow_track.hpp
@@ -178,11 +178,19 @@ protected:
}
}
- // tunnel tiles can be entered only from proper direction
- if (!IsWaterTT() && !m_is_tunnel && IsTunnelTile(m_new_tile)) {
- DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
- if (tunnel_enterdir != m_exitdir)
- return false;
+ // tunnel holes and bridge ramps can be entered only from proper direction
+ if (!IsWaterTT() && IsTileType(m_new_tile, MP_TUNNELBRIDGE)) {
+ if (IsTunnel(m_new_tile)) {
+ if (!m_is_tunnel) {
+ DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
+ if (tunnel_enterdir != m_exitdir) return false;
+ }
+ } else if (IsBridge(m_new_tile)) {
+ if (!m_is_bridge) {
+ DiagDirection ramp_enderdir = GetBridgeRampDirection(m_new_tile);
+ if (ramp_enderdir != m_exitdir) return false;
+ }
+ }
}
// special handling for rail stations - get to the end of platform