fix entity bounding box check on block place

This commit is contained in:
MihailRis 2026-04-05 10:55:30 +03:00
parent 9893c09fd5
commit bb44b4186b

View file

@ -482,7 +482,9 @@ void Entities::render(
bool Entities::hasBlockingInside(AABB aabb) {
auto view = registry->view<EntityId, Rigidbody>();
for (auto [entity, eid, body] : view.each()) {
if (eid.def.blocking && aabb.intersects(body.hitbox.getAABB(), -0.05f)) {
AABB bodyAABB(body.hitbox.getAABB());
bodyAABB.scale({1, 0.95f, 1});
if (eid.def.blocking && aabb.intersects(bodyAABB)) {
return true;
}
}