diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 19:10:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 19:10:52 +0100 |
commit | f9b74550252a9eaa19d779d8b4c9647a7c20d392 (patch) | |
tree | 2d1b56d569a494752e4d9c06bec7ff44d24fea8b /src/entity.cpp | |
parent | 2b52b695c25b373403c65e1df8ec0490539ccba7 (diff) |
a
Diffstat (limited to 'src/entity.cpp')
-rw-r--r-- | src/entity.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 23e9887d..3dc80fbc 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -123,8 +123,8 @@ bool entity::can_move_to(Vector2i delta) auto& c_ = coord.chunk() == coord_.chunk() ? c : w[coord_.chunk()]; const auto center = Vector2(coord_.local())*TILE_SIZE2 + Vector2(offset_) + Vector2(bbox_offset), - half_bbox = Vector2(bbox_size)*.5f, - min = center - half_bbox, max = center + half_bbox; + half_bbox = Vector2(bbox_size/2), + min = center - half_bbox, max = min + Vector2(bbox_size); bool ret = true; c_.rtree()->Search(min.data(), max.data(), [&](std::uint64_t data, const auto&) { |