From 49528f908dcebd66397c5145b36051f88590cd2c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 11 Apr 2023 23:46:38 +0100 Subject: [PATCH] Fix water infrastructure total when building multi-tile objects See: https://github.com/OpenTTD/OpenTTD/issues/10637 --- src/object_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index f994a6098e..f0b0eee69d 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -171,7 +171,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u if (IsWaterTile(t)) ClearNeighbourNonFloodingStates(t); WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID); /* Update company infrastructure counts for objects build on canals owned by nobody. */ - if (wc == WATER_CLASS_CANAL && owner != OWNER_NONE && (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, OWNER_WATER))) { + if (wc == WATER_CLASS_CANAL && owner != OWNER_NONE && (IsTileOwner(t, OWNER_NONE) || IsTileOwner(t, OWNER_WATER))) { Company::Get(owner)->infrastructure.water++; DirtyCompanyInfrastructureWindows(owner); }