Loading

Paste #pby9m1im8

  1.     if (HasTileWaterGround(tile) && GetWaterClass(tile) == WATER_CLASS_CANAL) {
  2.         if (IsDockTile(tile) || IsBuoyTile(tile) || IsOilRig(tile)) {
  3.             if (GetCanalOwner(tile) == old_owner) {
  4.                 Company::Get(old_owner)->infrastructure.water--;
  5.                 if (new_owner != INVALID_OWNER) {
  6.                     Company::Get(new_owner)->infrastructure.water++;
  7.                 } else {
  8.                     if (IsBuoyTile(tile)) {
  9.                         /* Remove unused buoys. */
  10.                         DoCommand(tile, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR);
  11.                         /* Set tile owner of canal under (now removed) buoy to OWNER_NONE. */
  12.                         if (IsTileType(tile, MP_WATER) && IsCanal(tile) && IsTileOwner(tile, old_owner)) SetTileOwner(tile, OWNER_NONE);
  13.                     }
  14.                 }
  15.                 SetCanalOwner(tile, new_owner == INVALID_OWNER ? OWNER_NONE : new_owner);
  16.             }
  17.         }
  18.     }

Comments