fix Entities.hasBlockingInside

This commit is contained in:
MihailRis
2024-07-10 06:40:10 +03:00
parent 93565d19ad
commit 5874abff98
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -405,9 +405,9 @@ void Entities::render(Assets* assets, ModelBatch& batch, const Frustum& frustum,
}
bool Entities::hasBlockingInside(AABB aabb) {
auto view = registry.view<EntityId, Transform>();
for (auto [entity, eid, transform] : view.each()) {
if (eid.def.blocking && aabb.contains(transform.pos)) {
auto view = registry.view<EntityId, Transform, Rigidbody>();
for (auto [entity, eid, transform, body] : view.each()) {
if (eid.def.blocking && aabb.intersect(body.hitbox.getAABB())) {
return true;
}
}