BGE: Fix to make KX_CharacterWrapper.jumpCount work a bit smoother. Previously jumpCo...
authorMitchell Stokes <mogurijin@gmail.com>
Sat, 9 Feb 2013 06:32:17 +0000 (06:32 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sat, 9 Feb 2013 06:32:17 +0000 (06:32 +0000)
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

index 01c56b4..0de21e3 100644 (file)
@@ -78,6 +78,9 @@ BlenderBulletCharacterController::BlenderBulletCharacterController(btMotionState
 
 void BlenderBulletCharacterController::updateAction(btCollisionWorld *collisionWorld, btScalar dt)
 {
+       if (onGround())
+               m_jumps = 0;
+
        btKinematicCharacterController::updateAction(collisionWorld,dt);
        m_motionState->setWorldTransform(getGhostObject()->getWorldTransform());
 }
@@ -104,9 +107,6 @@ bool BlenderBulletCharacterController::canJump() const
 
 void BlenderBulletCharacterController::jump()
 {
-       if (onGround())
-               m_jumps = 0;
-
        if (!canJump())
                return;