X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fclient%2Fcontent_cao.cpp;fp=src%2Fclient%2Fcontent_cao.cpp;h=da78cae7cd5d04a9ed1892a28aee273f899c1684;hb=1d69a23ba48d99b051dcf2a6be225edd7c644c7b;hp=83c8e15d4af94f4d47eb330c93b95d8ea8b50e9e;hpb=149d8fc8d6d92e8e0d6908125ad8d3179695b1ea;p=dragonfireclient.git diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index 83c8e15d4..da78cae7c 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -998,9 +998,7 @@ void GenericCAO::step(float dtime, ClientEnvironment *env) const PlayerControl &controls = player->getPlayerControl(); bool walking = false; - if (controls.up || controls.down || controls.left || controls.right || - controls.forw_move_joystick_axis != 0.f || - controls.sidew_move_joystick_axis != 0.f) + if (controls.movement_speed > 0.001f) walking = true; f32 new_speed = player->local_animation_speed; @@ -1015,9 +1013,10 @@ void GenericCAO::step(float dtime, ClientEnvironment *env) g_settings->getBool("free_move") && m_client->checkLocalPrivilege("fly")))) new_speed *= 1.5; - // slowdown speed if sneeking + // slowdown speed if sneaking if (controls.sneak && walking) new_speed /= 2; + new_speed *= controls.movement_speed; if (walking && (controls.dig || controls.place)) { new_anim = player->local_animations[3];