Tux can stop to backflip at will. Holding jump continues backflipping. Better fix...
authorWolfgang Becker <uafr@gmx.de>
Sat, 31 Aug 2013 15:06:46 +0000 (17:06 +0200)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 26 Oct 2013 16:45:20 +0000 (18:45 +0200)
src/object/player.cpp

index 11dd4d9..61b6bc1 100644 (file)
@@ -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<BadGuy*> (&other);
   if(badguy != NULL) {
     if(safe_timer.started() || invincible_timer.started())