Merge pull request #4014 from myk002/myk_burrow_flood

[burrow] allow 3d flood fill in hidden tiles
develop
Myk 2023-11-12 02:25:33 -08:00 committed by GitHub
commit ce3de1785f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

@ -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;
@ -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);
}
}