aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt.T <49764813+Matt-T-123@users.noreply.github.com>2026-03-12 12:32:27 +0000
committerGitHub <noreply@github.com>2026-03-12 12:32:27 +0000
commite6895620278582d7fd94c7fcfc63e1d5619d6740 (patch)
tree873f63d9d86995bc8e5da95dbbefaa8cdc1744f8
parentbb8ffee0d3249303e0691275166ff7e5741acfd8 (diff)
Fix SubEntity hitbox hit detection (#1175)
-rw-r--r--Minecraft.World/LevelChunk.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp
index 118dbcdd..29308e29 100644
--- a/Minecraft.World/LevelChunk.cpp
+++ b/Minecraft.World/LevelChunk.cpp
@@ -1628,18 +1628,18 @@ void LevelChunk::getEntities(shared_ptr<Entity> except, AABB *bb, vector<shared_
for (auto& e : *entities)
{
- if ( e && e != except && e->bb->intersects(bb) && (selector == nullptr || selector->matches(e)))
+ if (e && e != except && e->bb->intersects(bb) && (selector == nullptr || selector->matches(e)))
{
es.push_back(e);
+
vector<shared_ptr<Entity> > *subs = e->getSubEntities();
if (subs != nullptr)
{
- for (const auto& sub : *subs)
+ for (const auto& subEntity : *subs)
{
- e = sub;
- if ( e && e != except && e->bb->intersects(bb) && (selector == nullptr || selector->matches(e)))
+ if (subEntity && subEntity != except && subEntity->bb->intersects(bb) && (selector == nullptr || selector->matches(subEntity)))
{
- es.push_back(e);
+ es.push_back(subEntity);
}
}
}