From afae7ca8102a3e9b50ae149d91dd46a33e5bedd8 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 22 Dec 2018 18:44:16 +0000 Subject: [PATCH] Change custom bridge head second rail type infrastructure count factor --- src/tunnelbridge_map.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tunnelbridge_map.h b/src/tunnelbridge_map.h index 7693412428..4b2202dc10 100644 --- a/src/tunnelbridge_map.h +++ b/src/tunnelbridge_map.h @@ -223,7 +223,6 @@ static inline bool HasAcrossTunnelBridgeReservation(TileIndex t) */ static inline uint GetTunnelBridgeHeadOnlyRailInfrastructureCountFromTrackBits(TrackBits bits) { - if (!bits) return 0; uint pieces = CountBits(bits); if (TracksOverlap(bits)) pieces *= pieces; return (TUNNELBRIDGE_TRACKBIT_FACTOR / 2) * (1 + pieces); @@ -248,7 +247,7 @@ static inline uint GetTunnelBridgeHeadOnlyPrimaryRailInfrastructureCount(TileInd */ static inline uint GetTunnelBridgeHeadOnlySecondaryRailInfrastructureCount(TileIndex t) { - return IsBridge(t) ? GetTunnelBridgeHeadOnlyRailInfrastructureCountFromTrackBits(GetSecondaryTunnelBridgeTrackBits(t)) : 0; + return IsBridge(t) && GetSecondaryTunnelBridgeTrackBits(t) ? (TUNNELBRIDGE_TRACKBIT_FACTOR / 2) : 0; } /**