| 316 | // |
| 317 | |
| 318 | static void propagate_if_material_match(color_ostream& out, MapExtras::MapCache & mc, |
| 319 | int16_t mat, bool warm, bool damp, const df::coord & pos) |
| 320 | { |
| 321 | auto block = Maps::getTileBlock(pos); |
| 322 | if (!block) |
| 323 | return; |
| 324 | |
| 325 | INFO(log,out).print("testing adjacent tile at ({},{},{}), mat:{}", |
| 326 | pos.x, pos.y, pos.z, mc.veinMaterialAt(pos)); |
| 327 | |
| 328 | if (mat != mc.veinMaterialAt(pos)) |
| 329 | return; |
| 330 | |
| 331 | auto des = Maps::getTileDesignation(pos); |
| 332 | auto occ = Maps::getTileOccupancy(pos); |
| 333 | if (!des || !occ || !is_wall(pos)) |
| 334 | return; |
| 335 | |
| 336 | if (des->bits.hidden && ((warm && is_warm(pos)) || (damp && is_damp(pos)))) { |
| 337 | des->bits.dig = df::tile_dig_designation::Default; |
| 338 | occ->bits.dig_auto = true; |
| 339 | } |
| 340 | |
| 341 | if (warm) { |
| 342 | if (auto warm_mask = World::getPersistentTilemask(warm_config, block, true)) |
| 343 | warm_mask->setassignment(pos, true); |
| 344 | } |
| 345 | if (damp) { |
| 346 | if (auto damp_mask = World::getPersistentTilemask(damp_config, block, true)) |
| 347 | damp_mask->setassignment(pos, true); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | static void do_autodig(color_ostream& out, bool warm, bool damp, const df::coord & pos) { |
| 352 | MapExtras::MapCache mc; |
no test coverage detected