1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 02:42:42 +01:00

(svn r22702) [1.1] -Backport from trunk:

- Fix: Cost of adding an extra road type to a bridge or tunnel was undercalculated [FS#4680, FS#4681] (r22700, r22699)
- Fix: Only insert cleared object tiles into _cleared_object_areas if clearing actually succeeds, else subsequential tests of the same tile will be skipped and considered successful [FS#4694] (r22698)
- Fix: When building a house it could be built at the wrong place if multitile houses failed some tests (r22697)
This commit is contained in:
rubidium
2011-07-30 17:48:23 +00:00
parent a51531e410
commit be65972895
5 changed files with 25 additions and 11 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;
}