MCPcopy Create free account
hub / github.com/DFHack/dfhack / removeTileAquifer

Method removeTileAquifer

library/modules/Maps.cpp:1459–1485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457}
1458
1459bool 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
1487int Maps::removeAreaAquifer(df::coord pos1, df::coord pos2, std::function<bool(df::coord, df::map_block *)> filter) {
1488 int totalAffectedCount = 0;

Callers

nothing calls this directly

Calls 4

getTileBlockFunction · 0.85
isTileAquiferFunction · 0.85
getTileDesignationFunction · 0.85
getTileOccupancyFunction · 0.85

Tested by

no test coverage detected