Do not apply friction if Tux's x-velocity is zero.
authorWolfgang Becker <uafr@gmx.de>
Sat, 27 Jun 2009 16:13:55 +0000 (16:13 +0000)
committerWolfgang Becker <uafr@gmx.de>
Sat, 27 Jun 2009 16:13:55 +0000 (16:13 +0000)
SVN-Revision: 5904

src/object/player.cpp

index 25c72c9..58698be 100644 (file)
@@ -417,9 +417,9 @@ Player::apply_friction()
     float friction = WALK_ACCELERATION_X * (on_ice ? ICE_FRICTION_MULTIPLIER : NORMAL_FRICTION_MULTIPLIER);
     if(physic.get_velocity_x() < 0) {
       physic.set_acceleration_x(friction);
-    } else /*if(physic.get_velocity_x() > 0)*/ {
+    } else if(physic.get_velocity_x() > 0) {
       physic.set_acceleration_x(-friction);
-    }
+    } // no friction for physic.get_velocity_x() == 0
   }
 }