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)
|
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);
|
es.push_back(e);
|
||||||
|
|
||||||
vector<shared_ptr<Entity> > *subs = e->getSubEntities();
|
vector<shared_ptr<Entity> > *subs = e->getSubEntities();
|
||||||
if (subs != nullptr)
|
if (subs != nullptr)
|
||||||
{
|
{
|
||||||
for (const auto& sub : *subs)
|
for (const auto& subEntity : *subs)
|
||||||
{
|
{
|
||||||
e = sub;
|
if (subEntity && subEntity != except && subEntity->bb->intersects(bb) && (selector == nullptr || selector->matches(subEntity)))
|
||||||
if ( e && e != except && e->bb->intersects(bb) && (selector == nullptr || selector->matches(e)))
|
|
||||||
{
|
{
|
||||||
es.push_back(e);
|
es.push_back(subEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user