summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-21 23:31:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-21 23:31:42 +0200
commit0dd45783d24f3c6ebde0fadcd616148c4dfbd97b (patch)
tree7c3f2bdc9413b39c081db78273f5c1147b84f595 /src
parentaaf5245aba8daba3ec0b47974b8b7c7880a6738b (diff)
a
Diffstat (limited to 'src')
-rw-r--r--src/object.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/object.cpp b/src/object.cpp
index 6284e3e9..02051fbf 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -173,9 +173,10 @@ static bool do_search(struct chunk* c, chunk_coords_ coord,
return true;
}
bool ret = true;
- c->rtree()->Search(min.data(), max.data(), [&](object_id data, const auto&) {
+ c->rtree()->Search(min.data(), max.data(), [&](object_id data, const auto& r) {
auto x = std::bit_cast<collision_data>(data);
- if (x.data != id && x.pass != (uint64_t)pass_mode::pass)
+ if (x.data != id && x.pass != (uint64_t)pass_mode::pass &&
+ rect_intersects(min, max, {r.m_min[0], r.m_min[1]}, {r.m_max[0], r.m_max[1]}))
return ret = false;
else
return true;