# HG changeset patch # User KUDr # Date 1167417602 0 # Node ID 265af7def3aa6fe114ccfcb912b510256549cd8c # Parent a3d7068578bd6ffbafaf9341fcbf70e2cca1e4b4 (svn r7623) - Fix: [YAPF] trains/roadvehs trying to enter the bridge ramp from under bridge rail/road (introduced by bridge merge r7573) diff -r a3d7068578bd -r 265af7def3aa yapf/follow_track.hpp --- a/yapf/follow_track.hpp Fri Dec 29 17:56:34 2006 +0000 +++ b/yapf/follow_track.hpp Fri Dec 29 18:40:02 2006 +0000 @@ -178,11 +178,19 @@ } } - // 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