From 3116287f08ced51efb42af33f9069076e657ba27 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 14 Nov 2023 10:42:05 -0800 Subject: [PATCH] don't expand through tree branches unless they're pathable --- plugins/burrow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/burrow.cpp b/plugins/burrow.cpp index a9ac8fc22..7f357f254 100644 --- a/plugins/burrow.cpp +++ b/plugins/burrow.cpp @@ -523,6 +523,10 @@ static bool is_tree(const df::tiletype *tt) { return tileMaterial(*tt) == tiletype_material::TREE; } +static bool is_tree_trunk(const df::tiletype *tt) { + return is_tree(tt) && tileShape(*tt)== tiletype_shape::WALL; +} + // if the outside tile flag is set // or it's light and it's a tree // or there are just outside or light tree tiles above it @@ -595,7 +599,7 @@ static void flood_fill(lua_State *L, bool enable) { // only go one tile outside of a walkability group (trees don't count) df::tiletype *tt = Maps::getTileType(pos); - if (start_walk && start_walk != walk && tt && !is_tree(tt)) + if (start_walk && start_walk != walk && tt && !is_tree_trunk(tt)) continue; if (tt && tileShape(*tt) != df::tiletype_shape::RAMP_TOP) {