Skip to content

Commit 8019b72

Browse files
authored
Merge pull request #5523 from quietust/dignow
dig-now - properly handle UNDIGGABLE tiles
2 parents be4d0a1 + c6f3ebd commit 8019b72

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Template for new versions:
5858

5959
## Fixes
6060
- several fixes related to changes in file system handling in DF 52.01
61+
- `dig-now`: don't allow UNDIGGABLE stones to be excavated
6162

6263
## Misc Improvements
6364
- `autoclothing`: added a ``clear`` option to unset previously set orders

plugins/dig-now.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,10 @@ static bool is_diggable(MapExtras::MapCache &map, const DFCoord &pos,
450450
break;
451451
}
452452

453-
if (mat == df::tiletype_material::FEATURE) {
454-
// adamantine is the only is diggable feature
455-
t_feature feature;
456-
return map.BlockAtTile(pos)->GetLocalFeature(&feature)
457-
&& feature.type == feature_type::deep_special_tube;
458-
}
453+
MaterialInfo mi;
454+
mi.decode(map.baseMaterialAt(pos));
455+
if (mi.material != nullptr && mi.material->flags.is_set(df::material_flags::UNDIGGABLE))
456+
return false;
459457

460458
return true;
461459
}

0 commit comments

Comments
 (0)