| 94 | } |
| 95 | |
| 96 | static bool tile_watery(const df::coord &pos) |
| 97 | { // Determines if plant should be in wet or dry vector |
| 98 | int32_t x = pos.x, y = pos.y, z = pos.z - 1; |
| 99 | |
| 100 | for (int32_t dx = -2; dx <= 2; dx++) |
| 101 | { // Check 5x5 area under tile, skipping corners |
| 102 | for (int32_t dy = -2; dy <= 2; dy++) |
| 103 | { |
| 104 | if (abs(dx) == 2 && abs(dy) == 2) |
| 105 | continue; // Skip corners |
| 106 | |
| 107 | auto tt = Maps::getTileType(x+dx, y+dy, z); |
| 108 | if (!tt) |
| 109 | continue; // Invalid tile |
| 110 | |
| 111 | auto mat = tileMaterial(*tt); |
| 112 | if (mat == tiletype_material::POOL || |
| 113 | mat == tiletype_material::RIVER || |
| 114 | tileShape(*tt) == tiletype_shape::BROOK_BED) |
| 115 | { |
| 116 | return true; |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | command_result df_createplant(color_ostream &out, const df::coord &pos, const plant_options &options) |
| 125 | { |
no test coverage detected