[Issue 3] Fix for jittering when there are slopes that end in a wall
authorTobias Markus <tobbi@mozilla-uk.org>
Thu, 30 Jan 2014 13:32:13 +0000 (14:32 +0100)
committerTobias Markus <tobbi@mozilla-uk.org>
Thu, 30 Jan 2014 13:32:13 +0000 (14:32 +0100)
src/object/player.cpp

index 6c193d7..a408975 100644 (file)
@@ -1105,8 +1105,10 @@ Player::draw(DrawingContext& context)
   else if ((wants_buttjump || does_buttjump) && is_big()) {
     sprite->set_action(sa_prefix+"-buttjump"+sa_postfix);
   }
-  else if (!on_ground()) {
-    sprite->set_action(sa_prefix+"-jump"+sa_postfix);
+  else if (!on_ground() || fall_mode != ON_GROUND) {
+    if(physic.get_velocity_x() != 0 || fall_mode != ON_GROUND) {
+        sprite->set_action(sa_prefix+"-jump"+sa_postfix);
+    }
   }
   else {
     if (fabsf(physic.get_velocity_x()) < 1.0f) {