|
@@ -75,13 +75,13 @@ protected:
|
|
|
{
|
|
|
m_is_station = m_is_bridge = m_is_tunnel = false;
|
|
|
m_tiles_skipped = 0;
|
|
|
|
|
|
// extra handling for tunnels in our direction
|
|
|
if (IsTunnelTile(m_old_tile)) {
|
|
|
DiagDirection tunnel_enterdir = GetTunnelDirection(m_old_tile);
|
|
|
DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_old_tile);
|
|
|
if (tunnel_enterdir == m_exitdir) {
|
|
|
// we are entering the tunnel
|
|
|
FindLengthOfTunnelResult flotr = FindLengthOfTunnel(m_old_tile, m_exitdir);
|
|
|
m_new_tile = flotr.tile;
|
|
|
m_is_tunnel = true;
|
|
|
m_tiles_skipped = flotr.length - 1;
|
|
@@ -89,13 +89,13 @@ protected:
|
|
|
}
|
|
|
assert(ReverseDiagDir(tunnel_enterdir) == m_exitdir);
|
|
|
}
|
|
|
|
|
|
// extra handling for bridge ramp in our direction
|
|
|
if (IsBridgeTile(m_old_tile)) {
|
|
|
DiagDirection bridge_enterdir = GetBridgeRampDirection(m_old_tile);
|
|
|
DiagDirection bridge_enterdir = GetTunnelBridgeDirection(m_old_tile);
|
|
|
if (bridge_enterdir == m_exitdir) {
|
|
|
// we are entering the bridge ramp
|
|
|
m_new_tile = GetOtherBridgeEnd(m_old_tile);
|
|
|
uint32 bridge_length = GetBridgeLength(m_old_tile, m_new_tile);
|
|
|
m_tiles_skipped = bridge_length;
|
|
|
m_is_bridge = true;
|
|
@@ -205,21 +205,21 @@ protected:
|
|
|
}
|
|
|
|
|
|
// 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);
|
|
|
DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_new_tile);
|
|
|
if (tunnel_enterdir != m_exitdir) {
|
|
|
m_err = EC_NO_WAY;
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
} else if (IsBridge(m_new_tile)) {
|
|
|
if (!m_is_bridge) {
|
|
|
DiagDirection ramp_enderdir = GetBridgeRampDirection(m_new_tile);
|
|
|
DiagDirection ramp_enderdir = GetTunnelBridgeDirection(m_new_tile);
|
|
|
if (ramp_enderdir != m_exitdir) {
|
|
|
m_err = EC_NO_WAY;
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|