| 433 | }; |
| 434 | |
| 435 | static bool is_diggable(MapExtras::MapCache &map, const DFCoord &pos, |
| 436 | df::tiletype tt) { |
| 437 | df::tiletype_material mat = tileMaterial(tt); |
| 438 | switch (mat) { |
| 439 | case df::tiletype_material::CONSTRUCTION: |
| 440 | case df::tiletype_material::TREE: |
| 441 | case df::tiletype_material::ROOT: |
| 442 | case df::tiletype_material::MAGMA: |
| 443 | case df::tiletype_material::HFS: |
| 444 | case df::tiletype_material::UNDERWORLD_GATE: |
| 445 | return false; |
| 446 | default: |
| 447 | break; |
| 448 | } |
| 449 | |
| 450 | MaterialInfo mi; |
| 451 | mi.decode(map.baseMaterialAt(pos)); |
| 452 | if (mi.material != nullptr && mi.material->flags.is_set(df::material_flags::UNDIGGABLE)) |
| 453 | return false; |
| 454 | |
| 455 | return true; |
| 456 | } |
| 457 | |
| 458 | static bool dig_tile(color_ostream &out, MapExtras::MapCache &map, |
| 459 | const DFCoord &pos, df::tile_dig_designation designation, |
no test coverage detected