Only backflip if player is not holding down LEFT or RIGHT
authorChristoph Sommer <mail@christoph-sommer.de>
Wed, 1 Nov 2006 03:18:20 +0000 (03:18 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Wed, 1 Nov 2006 03:18:20 +0000 (03:18 +0000)
SVN-Revision: 4429

src/object/player.cpp

index f995622..de9d24c 100644 (file)
@@ -526,7 +526,7 @@ Player::handle_vertical_input()
   if(controller->pressed(Controller::JUMP) && (can_jump)) {
     if (duck) {
       // when running, only jump a little bit; else do a backflip
-      if (physic.get_velocity_x() != 0) do_jump(-300); else do_backflip();
+      if ((physic.get_velocity_x() != 0) || (controller->hold(Controller::LEFT)) || (controller->hold(Controller::RIGHT))) do_jump(-300); else do_backflip();
     } else {
       // jump a bit higher if we are running; else do a normal jump
       if (fabs(physic.get_velocity_x()) > MAX_WALK_XM) do_jump(-580); else do_jump(-520);