Browse Source

Fix PhysicsCharacter crash

If a PhysicsCharacter object is disabled it causes a crash.
Üstün Ergenoglu 11 years ago
parent
commit
0deb28b479
1 changed files with 3 additions and 0 deletions
  1. 3 0
      gameplay/src/PhysicsCharacter.cpp

+ 3 - 0
gameplay/src/PhysicsCharacter.cpp

@@ -650,6 +650,9 @@ void PhysicsCharacter::ActionInterface::debugDraw(btIDebugDraw* debugDrawer)
 
 void PhysicsCharacter::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep)
 {
+    if (!isEnabled())
+        return;
+
     GP_ASSERT(_ghostObject);
     GP_ASSERT(_node);