Skip to content

Commit c9070e5

Browse files
authored
Fix local digging animation (#11772)
1 parent c510037 commit c9070e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/client/content_cao.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,14 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
996996
m_velocity = v3f(0,0,0);
997997
m_acceleration = v3f(0,0,0);
998998
const PlayerControl &controls = player->getPlayerControl();
999+
f32 new_speed = player->local_animation_speed;
9991000

10001001
bool walking = false;
1001-
if (controls.movement_speed > 0.001f)
1002+
if (controls.movement_speed > 0.001f) {
1003+
new_speed *= controls.movement_speed;
10021004
walking = true;
1005+
}
10031006

1004-
f32 new_speed = player->local_animation_speed;
10051007
v2s32 new_anim = v2s32(0,0);
10061008
bool allow_update = false;
10071009

@@ -1016,7 +1018,6 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
10161018
// slowdown speed if sneaking
10171019
if (controls.sneak && walking)
10181020
new_speed /= 2;
1019-
new_speed *= controls.movement_speed;
10201021

10211022
if (walking && (controls.dig || controls.place)) {
10221023
new_anim = player->local_animations[3];

0 commit comments

Comments
 (0)