]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/content_cao.cpp
Joystick sensitivity for player movement (#11262)
[dragonfireclient.git] / src / client / content_cao.cpp
index 83c8e15d4af94f4d47eb330c93b95d8ea8b50e9e..da78cae7cd5d04a9ed1892a28aee273f899c1684 100644 (file)
@@ -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];