From: Wolfgang Becker Date: Sat, 31 Aug 2013 15:06:46 +0000 (+0200) Subject: Tux can stop to backflip at will. Holding jump continues backflipping. Better fix... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=32fd3744958ad847bd0ba99c0eb19246cc6b4d79;p=supertux.git Tux can stop to backflip at will. Holding jump continues backflipping. Better fix for bug #1008. --- 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())