From: Wolfgang Becker Date: Sat, 27 Jun 2009 16:13:55 +0000 (+0000) Subject: Do not apply friction if Tux's x-velocity is zero. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=53658c421bfe7148cb2781b793b194b4668a11ff;p=supertux.git Do not apply friction if Tux's x-velocity is zero. SVN-Revision: 5904 --- diff --git a/src/object/player.cpp b/src/object/player.cpp index 25c72c9c7..58698bebb 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -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 } }