From 186c5a1bb88c6f1fed9cf192758992c6f628ef8f Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 9 Nov 2023 15:51:44 -0800 Subject: [PATCH] allow 3d flood fill in hidden tiles --- plugins/burrow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/burrow.cpp b/plugins/burrow.cpp index 8e4bfef2e..b0da87f12 100644 --- a/plugins/burrow.cpp +++ b/plugins/burrow.cpp @@ -503,6 +503,9 @@ static int burrow_tiles_box_remove(lua_State *L) { // ramp tops inherit walkability group of the tile below static uint16_t get_walk_group(const df::coord & pos) { + df::tile_designation *des = Maps::getTileDesignation(pos); + if (!des || des->bits.hidden) + return 0; uint16_t walk = Maps::getWalkableGroup(pos); if (walk) return walk; @@ -544,7 +547,7 @@ static void flood_fill(lua_State *L, bool enable) { flood.pop(); df::tile_designation *des = Maps::getTileDesignation(pos); - if(!des || + if (!des || des->bits.outside != start_des->bits.outside || des->bits.hidden != start_des->bits.hidden) { @@ -578,9 +581,9 @@ static void flood_fill(lua_State *L, bool enable) { ++pos_above.z; df::tiletype *tt = Maps::getTileType(pos); df::tiletype *tt_above = Maps::getTileType(pos_above); - if (tt_above && LowPassable(*tt_above)) + if (tt_above && (!start_walk || LowPassable(*tt_above))) flood.emplace(pos_above); - if (tt && LowPassable(*tt)) + if (tt && (!start_walk || LowPassable(*tt))) flood.emplace(pos.x, pos.y, pos.z-1); } }