diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-06 02:31:55 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-06 02:31:55 +0400 |
commit | 958dc02774b104123c6124a9185815dfe389a529 (patch) | |
tree | bade9ef46b9993e1aeed13337d37e562992da069 /source/gameengine | |
parent | f8a68d50f7f5c53e0d8f16e0f5553a8e5b5b9c6c (diff) |
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.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) |