Remove redundant checks on open tiles

develop
plule 2023-07-17 15:42:08 +02:00
parent 04b0c16f0f
commit b8346cb069
3 changed files with 3 additions and 5 deletions

@ -131,7 +131,7 @@ static command_result autodump_main(color_ostream &out, vector <string> & 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;

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

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