Jelajahi Sumber

Fix PhysicsCharacter crash

If a PhysicsCharacter object is disabled it causes a crash.
Üstün Ergenoglu 11 tahun lalu
induk
melakukan
0deb28b479
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  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);