From 8d9827ba7ac7c16540f5c40666db00ef899c2c64 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 10 Sep 2023 08:18:27 +0200 Subject: simplify using implicit conversion operator --- src/object.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/object.cpp') diff --git a/src/object.cpp b/src/object.cpp index d0c4da57..b7439d31 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -173,11 +173,10 @@ bool object::can_move_to(Vector2i delta, global_coords coord2, Vector2b offset, const auto center = Vector2(coord_.local())*TILE_SIZE2 + Vector2(offset_) + Vector2(bbox_offset), half_bbox = Vector2(bbox_size)*.5f, min = center - half_bbox, max = min + Vector2(bbox_size); - auto ch = chunk_coords_{coord_.chunk(), coord_.z()}; - if (!do_search(&c_, ch, id, min, max)) + if (!do_search(&c_, coord_, id, min, max)) return false; for (const auto& off : world::neighbor_offsets) - if (!do_search(&c_, ch, id, min, max, off)) + if (!do_search(&c_, coord_, id, min, max, off)) return false; return true; } -- cgit v1.2.3