Skip to content

Commit

Permalink
change class name check to dynamic cast
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusGuy authored Jul 14, 2023
1 parent 6f45dad commit 34e206e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ Player::update(float dt_sec)
downbox.set_bottom(get_bbox().get_bottom() + 16.f);
for (auto& brick : Sector::get().get_objects_by_type<Brick>()) {
// stoneform breaks through any kind of bricks
if (downbox.contains(brick.get_bbox()) && (m_stone || brick.get_class_name() != "heavy-brick")) {
if (downbox.contains(brick.get_bbox()) && (m_stone || !dynamic_cast<HeavyBrick*>(&brick))) {
brick.try_break(this, is_big());
}
}
Expand Down

0 comments on commit 34e206e

Please sign in to comment.