yapf/follow_track.hpp
branchcustombridgeheads
changeset 5623 ef2a8a524a95
parent 5621 6ce400c0a2f4
child 5627 f5c656cf0a0e
--- a/yapf/follow_track.hpp	Mon Jan 01 16:10:01 2007 +0000
+++ b/yapf/follow_track.hpp	Mon Jan 01 16:31:13 2007 +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()) {
+			if (IsTunnelTile(m_new_tile)) {
+				if (!m_is_tunnel) {
+					DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
+					if (tunnel_enterdir != m_exitdir) return false;
+				}
+			} else if (IsBridgeTile(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