diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-02-09 10:32:17 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-02-09 10:32:17 +0400 |
commit | 8eabdad3aa7a135e9817e1860dad94e6c86974cf (patch) | |
tree | 8caabe2a5279049ae898fff847d090d198e331e2 /source/gameengine/Physics | |
parent | e3488af838e6c43e5e3d9635d7604ab04f5a9b27 (diff) |
BGE: Fix to make KX_CharacterWrapper.jumpCount work a bit smoother. Previously jumpCount was only getting reset to 0 if the character was on the ground while jump() was being called. This works alright internally for double jumping, but it made things awkward if a user wanted to check jumpCount before calling jump() (i.e., before jumpCount was updated).
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 01c56b43f4f..0de21e33eff 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -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; |