From 7ea8c843b1449ec077a78a292843d8c0e65d5195 Mon Sep 17 00:00:00 2001 From: myk002 Date: Sat, 12 Jun 2021 11:16:00 -0700 Subject: [PATCH] allow digging of surface tiles now that we handle colonies --- plugins/dig-now.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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;