Fix water infra total when building water over canal with object
See: https://github.com/OpenTTD/OpenTTD/issues/9870
This commit is contained in:
@@ -503,6 +503,14 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
|||||||
if (!water) cost.AddCost(ret);
|
if (!water) cost.AddCost(ret);
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
if (IsTileType(current_tile, MP_WATER) && IsCanal(current_tile)) {
|
||||||
|
Owner owner = GetTileOwner(tile);
|
||||||
|
if (Company::IsValidID(owner)) {
|
||||||
|
Company::Get(owner)->infrastructure.water--;
|
||||||
|
DirtyCompanyInfrastructureWindows(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (wc) {
|
switch (wc) {
|
||||||
case WATER_CLASS_RIVER:
|
case WATER_CLASS_RIVER:
|
||||||
MakeRiver(current_tile, Random());
|
MakeRiver(current_tile, Random());
|
||||||
|
Reference in New Issue
Block a user