mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-22 08:11:09 +05:00
Fix SubEntity hitbox hit detection (#1175)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user