Enable signals on bridges/tunnels to work with PBS.
This commit is contained in:
@@ -358,7 +358,7 @@ protected:
|
||||
if (IsTunnel(m_new_tile)) {
|
||||
if (!m_is_tunnel) {
|
||||
DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_new_tile);
|
||||
if (tunnel_enterdir != m_exitdir || IsTunnelBridgeExit(m_new_tile)) {
|
||||
if (tunnel_enterdir != m_exitdir) {
|
||||
m_err = EC_NO_WAY;
|
||||
return false;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ protected:
|
||||
} else { // IsBridge(m_new_tile)
|
||||
if (!m_is_bridge) {
|
||||
DiagDirection ramp_enderdir = GetTunnelBridgeDirection(m_new_tile);
|
||||
if (ramp_enderdir != m_exitdir || IsTunnelBridgeExit(m_new_tile)) {
|
||||
if (ramp_enderdir != m_exitdir) {
|
||||
m_err = EC_NO_WAY;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -936,6 +936,10 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (IsTileType(dst_tile, MP_TUNNELBRIDGE) && IsTunnelBridgeExit(dst_tile) && DiagDirToDiagTrackdir(GetTunnelBridgeDirection(dst_tile)) == dst_trackdir) {
|
||||
/* Entering a signalled bridge/tunnel from the wrong side, equivalent to encountering a one-way signal from the wrong side */
|
||||
break;
|
||||
}
|
||||
{
|
||||
/* We've found ourselves a neighbour :-) */
|
||||
AyStarNode *neighbour = &aystar->neighbours[i];
|
||||
|
||||
@@ -244,6 +244,10 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IsTileType(tile, MP_TUNNELBRIDGE) && IsTunnelBridgeExit(tile) && DiagDirToDiagTrackdir(GetTunnelBridgeDirection(tile)) == trackdir) {
|
||||
/* Entering a signalled bridge/tunnel from the wrong side, equivalent to encountering a one-way signal from the wrong side */
|
||||
n.m_segment->m_end_segment_reason |= ESRB_DEAD_END;
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user