From db90ea21361e51a1a7621bcee3c78d1857d51bba Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Mar 2023 03:52:44 +0100 Subject: src/entity: fix redundant condition --- src/entity.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/entity.cpp') diff --git a/src/entity.cpp b/src/entity.cpp index 20435f45..697abed0 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -90,11 +90,10 @@ size_t entity::index() const bool entity::can_rotate(global_coords coord, rotation new_r, rotation old_r, Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_size) { + if (bbox_offset.isZero() && bbox_size[0] == bbox_size[1]) + return true; const auto bbox_offset_ = rotate_point(bbox_offset, old_r, new_r); const auto bbox_size_ = rotate_size(bbox_size, old_r, new_r); - if (bbox_offset_.isZero() && bbox_size_[0] == bbox_size_[1] || - bbox_offset_ == bbox_offset && bbox_size_ == bbox_size) - return true; return can_move_to({}, coord, offset, bbox_offset_, bbox_size_); } -- cgit v1.2.3