Fix convert tool on road depots updating infra totals incorrectly

This commit is contained in:
Jonathan G Rennison
2019-09-17 00:45:47 +01:00
parent a30638bc4a
commit 4bd33c6bd0

View File

@@ -2609,7 +2609,13 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
} }
} }
uint num_pieces = CountBits(GetAnyRoadBits(tile, rtt));; uint num_pieces;
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
num_pieces = HasTileRoadType(tile, rtt) ? 2 : 0;
} else {
num_pieces = CountBits(GetAnyRoadBits(tile, rtt));
}
found_convertible_road = true; found_convertible_road = true;
cost.AddCost(num_pieces * RoadConvertCost(from_type, to_type)); cost.AddCost(num_pieces * RoadConvertCost(from_type, to_type));