diff --git a/plugins/dig-now.cpp b/plugins/dig-now.cpp index aaea4d50b..08e53f72b 100644 --- a/plugins/dig-now.cpp +++ b/plugins/dig-now.cpp @@ -284,13 +284,24 @@ struct dug_tile_info { } }; +static bool is_tree(df::tiletype tt) { + df::tiletype_material mat = tileMaterial(tt); + switch (mat) { + case df::tiletype_material::TREE: + case df::tiletype_material::ROOT: + return true; + default: + return false; + } +} + static bool dig_tile(color_ostream &out, MapExtras::MapCache &map, const DFCoord &pos, df::tile_dig_designation designation, std::vector &dug_tiles) { df::tiletype tt = map.tiletypeAt(pos); - df::tiletype_material tile_mat = tileMaterial(tt); - if (!isGroundMaterial(tile_mat)) + // TODO: handle trees, roots, and log generation + if (is_tree(tt)) return false; df::tiletype target_type = df::tiletype::Void;