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

Wrong tile used in ownership checks
pull/510/head
Jonathan G Rennison 1 year ago committed by rubidium42
parent 3b2eb11fe8
commit e17420777a

@ -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);
}

Loading…
Cancel
Save