equal
deleted
inserted
replaced
924 if (!IsLevelCrossing(tile)) return false; |
924 if (!IsLevelCrossing(tile)) return false; |
925 signal_ctr += 2; |
925 signal_ctr += 2; |
926 return true; |
926 return true; |
927 |
927 |
928 case MP_TUNNELBRIDGE: { |
928 case MP_TUNNELBRIDGE: { |
929 TileIndex orig_tile = tile; |
929 TileIndex orig_tile = tile; // backup old value |
930 /* Skip to end of tunnel or bridge */ |
930 |
931 if (IsBridge(tile)) { |
931 if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false; |
932 if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false; |
932 if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false; |
933 if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false; |
933 |
934 tile = GetOtherBridgeEnd(tile); |
934 /* Skip to end of tunnel or bridge |
935 } else { |
935 * note that tile is a parameter by reference, so it must be updated */ |
936 if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false; |
936 tile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile); |
937 if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false; |
937 |
938 tile = GetOtherTunnelEnd(tile); |
|
939 } |
|
940 signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2; |
938 signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2; |
941 return true; |
939 return true; |
942 } |
940 } |
943 |
941 |
944 default: return false; |
942 default: return false; |