static void ChangeTileOwner_Industry(TileIndex tile, Owner old_owner, Owner new_owner) { /* If the founder merges, the industry was created by the merged company */ Industry *i = Industry::GetByTile(tile); if (i->founder == old_owner) i->founder = (new_owner == INVALID_OWNER) ? OWNER_NONE : new_owner; if (HasTileWaterGround(tile) && GetWaterClass(tile) == WATER_CLASS_CANAL) { if (GetCanalOwner(tile) == old_owner) { Company::Get(old_owner)->infrastructure.water--; if (new_owner != INVALID_OWNER) Company::Get(new_owner)->infrastructure.water++; SetCanalOwner(tile, new_owner == INVALID_OWNER ? OWNER_NONE : new_owner); } } }