Merge pull request #3575 from plule/cleanup_open_tiles

Remove redundant checks on open tiles
develop
Myk 2023-07-17 12:59:23 -07:00 committed by GitHub
commit 62b311c6d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; return CR_FAILURE;
} }
df::tiletype ttype = MC.tiletypeAt(pos_cursor); 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"); out.printerr("Cursor should be placed over a floor.\n");
return CR_FAILURE; return CR_FAILURE;

@ -120,8 +120,7 @@ df::coord simulate_fall(const df::coord &pos) {
while (Maps::ensureTileBlock(resting_pos)) { while (Maps::ensureTileBlock(resting_pos)) {
df::tiletype tt = *Maps::getTileType(resting_pos); df::tiletype tt = *Maps::getTileType(resting_pos);
df::tiletype_shape_basic basic_shape = tileShapeBasic(tileShape(tt)); if (isWalkable(tt))
if (isWalkable(tt) && basic_shape != df::tiletype_shape_basic::Open)
break; break;
--resting_pos.z; --resting_pos.z;
} }

@ -832,8 +832,7 @@ static DFCoord simulate_fall(const DFCoord &pos) {
while (Maps::ensureTileBlock(resting_pos)) { while (Maps::ensureTileBlock(resting_pos)) {
df::tiletype tt = *Maps::getTileType(resting_pos); df::tiletype tt = *Maps::getTileType(resting_pos);
df::tiletype_shape_basic basic_shape = tileShapeBasic(tileShape(tt)); if (isWalkable(tt))
if (isWalkable(tt) && basic_shape != df::tiletype_shape_basic::Open)
break; break;
--resting_pos.z; --resting_pos.z;
} }