Loading

Paste #pfzbrepaq

  1. static void ChangeTileOwner_Industry(TileIndex tile, Owner old_owner, Owner new_owner)
  2. {
  3.     /* If the founder merges, the industry was created by the merged company */
  4.     Industry *i = Industry::GetByTile(tile);
  5.     if (i->founder == old_owner) i->founder = (new_owner == INVALID_OWNER) ? OWNER_NONE : new_owner;
  6.  
  7.     if (HasTileWaterGround(tile) && GetWaterClass(tile) == WATER_CLASS_CANAL) {
  8.         if (GetCanalOwner(tile) == old_owner) {
  9.             Company::Get(old_owner)->infrastructure.water--;
  10.             if (new_owner != INVALID_OWNER) Company::Get(new_owner)->infrastructure.water++;
  11.             SetCanalOwner(tile, new_owner == INVALID_OWNER ? OWNER_NONE : new_owner);
  12.         }
  13.     }
  14. }

Comments