summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 03:52:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 03:53:34 +0100
commitdb90ea21361e51a1a7621bcee3c78d1857d51bba (patch)
treec48385069bc15a040e5d485dd97c6a92126a3e3c /src
parent5cf5ffa302324b6a35eab2581cce57c5ea4242ea (diff)
src/entity: fix redundant condition
Diffstat (limited to 'src')
-rw-r--r--src/entity.cpp5
1 files changed, 2 insertions, 3 deletions
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_);
}