From 430e4dccb07a0d402194f1bf6fae45646269f0f1 Mon Sep 17 00:00:00 2001 From: Wolfgang Becker Date: Thu, 29 Aug 2013 18:28:09 +0200 Subject: [PATCH] Tux can stop to backflip when landing on objects. Holding jump still continues backflipping. Fixes bug #1008. --- src/object/player.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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()) -- 2.11.0