From c25d089f72f1e3c3cc3ef0070373cbd35e47f9d3 Mon Sep 17 00:00:00 2001 From: Wolfgang Becker Date: Sat, 31 Aug 2013 17:06:46 +0200 Subject: [PATCH] Tux can stop to backflip at will. Holding jump continues backflipping. Better fix for bug #1008. --- src/object/player.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 11dd4d996..61b6bc14d 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -829,6 +829,12 @@ Player::handle_input() log_debug << "Non MovingObject grabbed?!?" << std::endl; } } + + /* stop backflipping at will */ + if( backflipping && ( !controller->hold(Controller::JUMP) ) ){ + backflipping = false; + backflip_direction = 0; + } } void @@ -1253,12 +1259,6 @@ 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