summaryrefslogtreecommitdiffhomepage
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-11 14:31:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-11 14:31:36 +0200
commit1dc1da05808f92ba7d26d539818e9aaf98725be5 (patch)
tree29cdefb7dd9774821b19019c69a843a1168f3d3a /src/entity.cpp
parenta77135dcc85bfa28a783fadc0c682d30f9c2b02e (diff)
src: add more chunk_coords operators
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp5
1 files changed, 1 insertions, 4 deletions
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<false>(&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;