Loading

Paste #pmtjm5zum

  1.     /* Check whether this industry provides its own station */
  2.     bool oil_rig = false;
  3.     TILE_AREA_LOOP(tile_cur, ind->location) {
  4.         if (IsTileType(tile_cur, MP_INDUSTRY) && GetIndustryGfx(tile_cur) == GFX_OILRIG_1) {
  5.             TileIndex other = tile_cur + TileDiffXY(0, -1);
  6.             if (IsTileType(other, MP_STATION) && IsOilRig(other) ||
  7.                 IsTileType(other, MP_INDUSTRY) && GetIndustryGfx(other) == GFX_OILRIG_1 && ind->index == GetIndustryIndex(other)) {
  8.                 oil_rig = true;
  9.             }
  10.         } else if (IsTileType(tile_cur, MP_STATION) && IsOilRig(tile_cur)) {
  11.             TileIndex other = tile_cur + TileDiffXY(0, 1);
  12.             if (IsTileType(other, MP_INDUSTRY) && GetIndustryGfx(other) == GFX_OILRIG_1 && ind->index == GetIndustryIndex(other)) {
  13.                 oil_rig = true;
  14.             }
  15.         }
  16.     }

Comments