mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-08 23:08:56 +00:00
Fix SubEntity hitbox hit detection (#1175)
This commit is contained in:
parent
bb8ffee0d3
commit
e689562027
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue