mirror of https://github.com/OpenTTD/OpenTTD
Fix #10637: Incorrect water infra total when building multi-tile object
Wrong tile used in ownership checkspull/10643/head
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…
Reference in New Issue