Revert "Fix #9870: Don't update infrastructure totals when overbuilding object on canal"

This reverts commit 37d318c410.

Use 0a31b27a20 instead.
pull/510/head
Jonathan G Rennison 1 year ago
parent 49528f908d
commit d0299e4c16

@ -537,14 +537,11 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
FALLTHROUGH;
default:
/* If we overbuild a water object with a canal, don't update the infrastructure total. */
bool is_existing_canal = IsTileType(current_tile, MP_WATER) && IsCanal(current_tile);
if (Company::IsValidID(_current_company) && !is_existing_canal) {
MakeCanal(current_tile, _current_company, Random());
if (Company::IsValidID(_current_company)) {
Company::Get(_current_company)->infrastructure.water++;
DirtyCompanyInfrastructureWindows(_current_company);
}
MakeCanal(current_tile, _current_company, Random());
break;
}
MarkTileDirtyByTile(current_tile);

Loading…
Cancel
Save