mirror of
https://github.com/Squareville/TestEventServer.git
synced 2026-01-04 16:42:56 -06:00
Potential solution
This commit is contained in:
@@ -40,18 +40,6 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Com
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), radius, false);
|
||||
m_dpEntity->SetCollisionGroup(COLLISION_GROUP_DYNAMIC | COLLISION_GROUP_FRIENDLY);
|
||||
dpWorld::Instance().AddEntity(m_dpEntity);
|
||||
|
||||
auto triggers = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_PHANTOM_PHYSICS);
|
||||
|
||||
for (auto* trigger : triggers) {
|
||||
for (const auto* event : trigger->GetTrigger()->events) {
|
||||
if (event->eventID == "OnEnter") {
|
||||
if (dpCollisionChecks::AreColliding(trigger->GetComponent<PhantomPhysicsComponent>()->GetdpEntity(), this->m_dpEntity)) {
|
||||
trigger->TriggerEvent("OnEnter", this->m_Parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user