Fix LocalPlayer-bound sound playback broken by 81c2370

This commit is contained in:
SmallJoker 2019-12-05 20:35:31 +01:00
parent ef8bf3cf35
commit f6de86ce4b

@ -834,18 +834,19 @@ void GenericCAO::updateNodePos()
void GenericCAO::step(float dtime, ClientEnvironment *env) 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) { if (m_is_local_player) {
LocalPlayer *player = m_env->getLocalPlayer(); 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) { if (m_is_visible) {
int old_anim = player->last_animation; int old_anim = player->last_animation;
float old_anim_speed = player->last_animation_speed; 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_velocity = v3f(0,0,0);
m_acceleration = 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(); const PlayerControl &controls = player->getPlayerControl();
bool walking = false; bool walking = false;