summaryrefslogtreecommitdiffhomepage
path: root/src/entity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp4
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&) {