| 230 | } |
| 231 | |
| 232 | static int aquifer_add(color_ostream &out, string aq_type, |
| 233 | df::coord pos1, df::coord pos2, int skip_top, int levels, bool leaky) |
| 234 | { |
| 235 | DEBUG(log,out).print("entering aquifer_add: aq_type={}, pos1={}, pos2={}, skip_top={}, levels={}, leaky={}\n", |
| 236 | aq_type, pos1, pos2, skip_top, levels, leaky); |
| 237 | |
| 238 | const bool heavy_state = aq_type == "heavy"; |
| 239 | |
| 240 | int modified = Maps::setAreaAquifer(pos1, pos2, heavy_state, [&](df::coord pos, df::map_block* block) -> bool { |
| 241 | TRACE(log, out).print("examining tile: pos={}\n", pos); |
| 242 | return (leaky || !is_leaky(pos)) |
| 243 | && (!Maps::isTileAquifer(pos) || Maps::isTileHeavyAquifer(pos) != heavy_state); |
| 244 | }); |
| 245 | |
| 246 | DEBUG(log, out).print("added aquifer tiles in area: pos1={}, pos2={}, heavy_state={}, count={}\n", |
| 247 | pos1, pos2, heavy_state, modified); |
| 248 | |
| 249 | return modified; |
| 250 | } |
| 251 | |
| 252 | DFHACK_PLUGIN_LUA_FUNCTIONS { |
| 253 | DFHACK_LUA_FUNCTION(aquifer_list), |
nothing calls this directly
no test coverage detected