Fix for [#32270] "Removing a Character object from the scene causes a crash." reporte...
authorMitchell Stokes <mogurijin@gmail.com>
Sun, 5 Aug 2012 22:31:55 +0000 (22:31 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sun, 5 Aug 2012 22:31:55 +0000 (22:31 +0000)
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

index 79898cdc0d4f20e242fca1070cb7501677de4085..5d28bf47401e52bf5de5055e2b0e990fec5e766e 100644 (file)
@@ -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)