From 4feea0ac6845ea025e8784f63f48e567d1d24c22 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 18 Aug 2013 15:49:09 +0200 Subject: Add offset to automatic_face_movement_dir --- src/content_sao.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 9b4ae6100..85ab8d307 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -527,8 +527,9 @@ void LuaEntitySAO::step(float dtime, bool send_recommended) m_velocity += dtime * m_acceleration; } - if(m_prop.automatic_face_movement_dir){ - m_yaw = atan2(m_velocity.Z,m_velocity.X) * 180 / M_PI; + if((m_prop.automatic_face_movement_dir) && + (fabs(m_velocity.Z) > 0.001 || fabs(m_velocity.X) > 0.001)){ + m_yaw = atan2(m_velocity.Z,m_velocity.X) * 180 / M_PI + m_prop.automatic_face_movement_dir_offset; } } -- cgit v1.2.3