diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-21 23:31:42 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-21 23:31:42 +0200 |
commit | 0dd45783d24f3c6ebde0fadcd616148c4dfbd97b (patch) | |
tree | 7c3f2bdc9413b39c081db78273f5c1147b84f595 /src | |
parent | aaf5245aba8daba3ec0b47974b8b7c7880a6738b (diff) |
a
Diffstat (limited to 'src')
-rw-r--r-- | src/object.cpp | 5 |
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; |