Fix LocalPlayer-bound sound playback broken by 81c2370
authorSmallJoker <mk939@ymail.com>
Thu, 5 Dec 2019 19:35:31 +0000 (20:35 +0100)
committerSmallJoker <mk939@ymail.com>
Thu, 5 Dec 2019 19:52:30 +0000 (20:52 +0100)
src/client/content_cao.cpp

index a15c1cc0ba6b57cdf3ad3d7850a0df4b7e259bf5..5521a6cf1249abf99d74c02a70c683fc0488d4e0 100644 (file)
@@ -834,18 +834,19 @@ void GenericCAO::updateNodePos()
 
 void GenericCAO::step(float dtime, ClientEnvironment *env)
 {
-       // Handel model of local player instantly to prevent lags
+       // Handle model animations and update positions instantly to prevent lags
        if (m_is_local_player) {
                LocalPlayer *player = m_env->getLocalPlayer();
+               m_position = player->getPosition();
+               pos_translator.val_current = m_position;
+               m_rotation.Y = wrapDegrees_0_360(player->getYaw());
+               rot_translator.val_current = m_rotation;
+
                if (m_is_visible) {
                        int old_anim = player->last_animation;
                        float old_anim_speed = player->last_animation_speed;
-                       m_position = player->getPosition();
-                       m_rotation.Y = wrapDegrees_0_360(player->getYaw());
                        m_velocity = v3f(0,0,0);
                        m_acceleration = v3f(0,0,0);
-                       pos_translator.val_current = m_position;
-                       rot_translator.val_current = m_rotation;
                        const PlayerControl &controls = player->getPlayerControl();
 
                        bool walking = false;