From 958dc02774b104123c6124a9185815dfe389a529 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 5 Aug 2012 22:31:55 +0000 Subject: Fix for [#32270] "Removing a Character object from the scene causes a crash." reported by me. The character's action wasn't being removed from the dynamics world when the character controller was. --- source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/gameengine') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 79898cdc0d4..5d28bf47401 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -451,6 +451,11 @@ bool CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr } else { m_dynamicsWorld->removeCollisionObject(ctrl->GetCollisionObject()); + + if (ctrl->GetCharacterController()) + { + m_dynamicsWorld->removeAction(ctrl->GetCharacterController()); + } } } if (ctrl->m_registerCount != 0) -- cgit v1.2.3