diff --git a/src/Systems/PhysicsSystem.cpp b/src/Systems/PhysicsSystem.cpp index b031c87..2ce99da 100644 --- a/src/Systems/PhysicsSystem.cpp +++ b/src/Systems/PhysicsSystem.cpp @@ -908,7 +908,17 @@ bool Systems::PhysicsSystem::OnDead( const Events::Dead &e ) m_RigidBodyEntities.erase(m_RigidBodies[e.Entity]); m_RigidBodies.erase(e.Entity);*/ - m_World->RemoveComponent(e.Entity); + auto jeep = m_World->GetComponent(e.Entity); + if(jeep) + { + m_World->RemoveComponent(e.Entity); + } + + auto tank = m_World->GetComponent(e.Entity); + if(tank) + { + m_World->RemoveComponent(e.Entity); + } } return true; diff --git a/src/Systems/PhysicsSystem.h b/src/Systems/PhysicsSystem.h index 1adc355..9be1694 100644 --- a/src/Systems/PhysicsSystem.h +++ b/src/Systems/PhysicsSystem.h @@ -90,6 +90,7 @@ #include "Events/EnterTrigger.h" #include "Events/JeepSteer.h" #include "Events/Dead.h" +#include "Components/JeepSteering.h" namespace Systems {