From 1dc1da05808f92ba7d26d539818e9aaf98725be5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 11 Apr 2023 14:31:36 +0200 Subject: src: add more chunk_coords operators --- src/entity.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/entity.cpp') diff --git a/src/entity.cpp b/src/entity.cpp index 13f19620..8aa3752f 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -170,10 +170,7 @@ bool entity::can_move_to(Vector2i delta, global_coords coord2, Vector2b offset, auto ch = chunk_coords_{coord_.chunk(), coord_.z()}; if (!do_search(&c_, ch, id, min, max)) return false; - constexpr Vector2b offsets[] = { - {-1, -1}, {-1, 0}, { 0, -1}, { 1, 1}, { 1, 0}, { 0, 1}, { 1, -1}, {-1, 1}, - }; - for (const auto& off : offsets) + for (const auto& off : world::neighbor_offsets) if (!do_search(&c_, ch, id, min, max, off)) return false; return true; -- cgit v1.2.3