From: Wolfgang Becker Date: Thu, 29 Aug 2013 16:28:09 +0000 (+0200) Subject: Tux can stop to backflip when landing on objects. Holding jump still continues backfl... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=430e4dccb07a0d402194f1bf6fae45646269f0f1;p=supertux.git Tux can stop to backflip when landing on objects. Holding jump still continues backflipping. Fixes bug #1008. --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 427c6532b..11dd4d996 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -1253,6 +1253,12 @@ Player::collision(GameObject& other, const CollisionHit& hit) return FORCE_MOVE; } + if( backflipping && hit.bottom && ( !controller->hold(Controller::JUMP) ) ){ + // allow to stop backflipping when landing on objects + backflipping = false; + backflip_direction = 0; + } + BadGuy* badguy = dynamic_cast (&other); if(badguy != NULL) { if(safe_timer.started() || invincible_timer.started())