From a73bc141a19711294a02cad6656ca3abfa16acd0 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 25 Jun 2022 14:09:51 +0100 Subject: [PATCH] Remove unneeded calls to GetOtherTunnelBridgeEnd in AfterLoadCompanyStats --- src/saveload/company_sl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index 1a3ca65d72..eae014b581 100644 --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -206,9 +206,10 @@ void AfterLoadCompanyStats() break; case MP_TUNNELBRIDGE: { - /* Only count the tunnel/bridge if we're on the northern end tile. */ - TileIndex other_end = GetOtherTunnelBridgeEnd(tile); - if (tile < other_end) { + /* Only count the tunnel/bridge if we're on the western end tile. */ + if (GetTunnelBridgeDirection(tile) < DIAGDIR_SW) { + TileIndex other_end = GetOtherTunnelBridgeEnd(tile); + /* Count each tunnel/bridge TUNNELBRIDGE_TRACKBIT_FACTOR times to simulate * the higher structural maintenance needs, and don't forget the end tiles. */ const uint middle_len = GetTunnelBridgeLength(tile, other_end) * TUNNELBRIDGE_TRACKBIT_FACTOR;