1
0
Fork 0

Fix #10637: Incorrect water infra total when building multi-tile object

Wrong tile used in ownership checks
pull/10643/head
Jonathan G Rennison 2023-04-12 00:13:39 +01:00 committed by rubidium42
parent 3b2eb11fe8
commit e17420777a
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
for (TileIndex t : ta) {
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);
}