Loading

https://imgur.com/wQuDOi5

  1. https://imgur.com/wQuDOi5
  2.  
  3. static bool GrowingOnWateredTile(TileIndex tile)
  4. {
  5.     TrackBits water_track = TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0));
  6.     if (water_track != TRACK_BIT_NONE) {
  7.         if (water_track == TRACK_BIT_UPPER || water_track == TRACK_BIT_LOWER || water_track == TRACK_BIT_LEFT || water_track == TRACK_BIT_RIGHT) {
  8.             if (water_track == TRACK_BIT_UPPER) {
  9.                 TileIndex opposite_tile = TileAddWrap(tile, -1, -1);
  10.                 TrackBits opposite_track = TRACK_BIT_LOWER;
  11.  
  12.                 TileIndex next_tile_1 = TileAddWrap(tile, -1, 0);
  13.                 TrackBits next_track_1 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_Y | TRACK_BIT_UPPER : TRACK_BIT_3WAY_NW;
  14.  
  15.                 TileIndex next_tile_2 = TileAddWrap(tile, 0, -1);
  16.                 TrackBits next_track_2 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_X | TRACK_BIT_UPPER : TRACK_BIT_3WAY_NE;
  17.             } else if (water_track == TRACK_BIT_LOWER) {
  18.                 TileIndex opposite_tile = TileAddWrap(tile, 1, 1);
  19.                 TrackBits opposite_track = TRACK_BIT_UPPER;
  20.  
  21.                 TileIndex next_tile_1 = TileAddWrap(tile, 1, 0);
  22.                 TrackBits next_track_1 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_Y | TRACK_BIT_LOWER : TRACK_BIT_3WAY_SE;
  23.  
  24.                 TileIndex next_tile_2 = TileAddWrap(tile, 0, 1);
  25.                 TrackBits next_track_2 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_X | TRACK_BIT_LOWER : TRACK_BIT_3WAY_SW;
  26.             } else if (water_track == TRACK_BIT_LEFT) {
  27.                 TileIndex opposite_tile = TileAddWrap(tile, 1, -1);
  28.                 TrackBits opposite_track = TRACK_BIT_RIGHT;
  29.  
  30.                 TileIndex next_tile_1 = TileAddWrap(tile, 0, -1);
  31.                 TrackBits next_track_1 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_X | TRACK_BIT_LEFT : TRACK_BIT_3WAY_SW;
  32.  
  33.                 TileIndex next_tile_2 = TileAddWrap(tile, 1, 0);
  34.                 TrackBits next_track_2 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_Y | TRACK_BIT_LEFT : TRACK_BIT_3WAY_NW;
  35.             } else if (water_track == TRACK_BIT_RIGHT) {
  36.                 TileIndex opposite_tile = TileAddWrap(tile, -1, 1);
  37.                 TrackBits opposite_track = TRACK_BIT_LEFT;
  38.  
  39.                 TileIndex next_tile_1 = TileAddWrap(tile, 0, 1);
  40.                 TrackBits next_track_1 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_X | TRACK_BIT_RIGHT : TRACK_BIT_3WAY_NE;
  41.  
  42.                 TileIndex next_tile_2 = TileAddWrap(tile, -1, 0);
  43.                 TrackBits next_track_2 = _settings_game.pf.forbid_90_deg ? TRACK_BIT_Y | TRACK_BIT_RIGHT : TRACK_BIT_3WAY_SE;
  44.             }
  45.             return false;
  46.         }
  47.         return false;
  48.     }
  49.     return false;
  50. }

Comments