| 1457 | } |
| 1458 | |
| 1459 | bool Maps::removeTileAquifer(int32_t x, int32_t y, int32_t z) { |
| 1460 | df::map_block *block = Maps::getTileBlock(x, y, z); |
| 1461 | if (!block) |
| 1462 | return false; |
| 1463 | if (!isTileAquifer(x, y, z)) |
| 1464 | return true; |
| 1465 | |
| 1466 | auto des = Maps::getTileDesignation(x, y, z); |
| 1467 | des->bits.water_table = false; |
| 1468 | auto occ = Maps::getTileOccupancy(x, y, z); |
| 1469 | occ->bits.heavy_aquifer = false; |
| 1470 | |
| 1471 | if (block->flags.bits.has_aquifer) { |
| 1472 | auto blockHasAquifer = [block]() -> bool { |
| 1473 | for (auto& row : block->designation) |
| 1474 | for (auto& col : row) |
| 1475 | if (col.bits.water_table) |
| 1476 | return true; |
| 1477 | return false; |
| 1478 | }; |
| 1479 | if (!blockHasAquifer()) { |
| 1480 | block->flags.bits.has_aquifer = false; |
| 1481 | block->flags.bits.check_aquifer = false; |
| 1482 | } |
| 1483 | } |
| 1484 | return true; |
| 1485 | } |
| 1486 | |
| 1487 | int Maps::removeAreaAquifer(df::coord pos1, df::coord pos2, std::function<bool(df::coord, df::map_block *)> filter) { |
| 1488 | int totalAffectedCount = 0; |
nothing calls this directly
no test coverage detected