From d3dca03f476046d88b27dae641f6b0e02d2c0a21 Mon Sep 17 00:00:00 2001 From: ViktorLjung Date: Thu, 5 Jun 2014 06:56:42 +0200 Subject: [PATCH] fix --- src/Systems/PhysicsSystem.cpp | 12 +++++++++++- src/Systems/PhysicsSystem.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) 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 {