From b8346cb069a9d40c758277df295a9601b49d961c Mon Sep 17 00:00:00 2001 From: plule <630159+plule@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:42:08 +0200 Subject: [PATCH] Remove redundant checks on open tiles --- plugins/autodump.cpp | 2 +- plugins/channel-safely/channel-safely-plugin.cpp | 3 +-- plugins/dig-now.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index a214f5c94..3c8638cea 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -131,7 +131,7 @@ static command_result autodump_main(color_ostream &out, vector & parame return CR_FAILURE; } df::tiletype ttype = MC.tiletypeAt(pos_cursor); - if(!DFHack::isWalkable(ttype) || DFHack::isOpenTerrain(ttype)) + if(!DFHack::isWalkable(ttype)) { out.printerr("Cursor should be placed over a floor.\n"); return CR_FAILURE; diff --git a/plugins/channel-safely/channel-safely-plugin.cpp b/plugins/channel-safely/channel-safely-plugin.cpp index 910e0ee7c..a297bf700 100644 --- a/plugins/channel-safely/channel-safely-plugin.cpp +++ b/plugins/channel-safely/channel-safely-plugin.cpp @@ -120,8 +120,7 @@ df::coord simulate_fall(const df::coord &pos) { while (Maps::ensureTileBlock(resting_pos)) { df::tiletype tt = *Maps::getTileType(resting_pos); - df::tiletype_shape_basic basic_shape = tileShapeBasic(tileShape(tt)); - if (isWalkable(tt) && basic_shape != df::tiletype_shape_basic::Open) + if (isWalkable(tt)) break; --resting_pos.z; } diff --git a/plugins/dig-now.cpp b/plugins/dig-now.cpp index 1cd56255b..028d4af6d 100644 --- a/plugins/dig-now.cpp +++ b/plugins/dig-now.cpp @@ -832,8 +832,7 @@ static DFCoord simulate_fall(const DFCoord &pos) { while (Maps::ensureTileBlock(resting_pos)) { df::tiletype tt = *Maps::getTileType(resting_pos); - df::tiletype_shape_basic basic_shape = tileShapeBasic(tileShape(tt)); - if (isWalkable(tt) && basic_shape != df::tiletype_shape_basic::Open) + if (isWalkable(tt)) break; --resting_pos.z; }