1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

(svn r22700) -Fix [FS#4680]: cost of changing bridge type is undercalculated when adding road types as well (based on patch by adf88)

This commit is contained in:
rubidium
2011-07-30 14:10:12 +00:00
parent cfc2c5db42
commit 7b418502ab
2 changed files with 6 additions and 2 deletions

View File

@@ -420,7 +420,11 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
Money infra_cost = 0;
switch (transport_type) {
case TRANSPORT_ROAD: infra_cost = (bridge_len + 2) * _price[PR_BUILD_ROAD] * 2; break;
case TRANSPORT_ROAD:
infra_cost = (bridge_len + 2) * _price[PR_BUILD_ROAD] * 2;
/* In case we add a new road type as well, we must be aware of those costs. */
if (IsBridgeTile(start)) infra_cost *= CountBits(GetRoadTypes(start) | (RoadTypes)road_rail_type);
break;
case TRANSPORT_RAIL: infra_cost = (bridge_len + 2) * RailBuildCost((RailType)road_rail_type); break;
default: break;
}