Fix walking sound of other players (and other objects)

This commit is contained in:
Perttu Ahola 2012-03-30 13:33:59 +03:00
parent 3241ad3ae8
commit 6b20ea0752

@ -885,7 +885,8 @@ public:
m_step_distance_counter = 0; m_step_distance_counter = 0;
if(!m_is_local_player && m_prop.makes_footstep_sound){ if(!m_is_local_player && m_prop.makes_footstep_sound){
INodeDefManager *ndef = m_gamedef->ndef(); INodeDefManager *ndef = m_gamedef->ndef();
v3s16 p = floatToInt(getPosition()+v3f(0,-0.5*BS, 0), BS); v3s16 p = floatToInt(getPosition() + v3f(0,
(m_prop.collisionbox.MinEdge.Y-0.5)*BS, 0), BS);
MapNode n = m_env->getMap().getNodeNoEx(p); MapNode n = m_env->getMap().getNodeNoEx(p);
SimpleSoundSpec spec = ndef->get(n).sound_footstep; SimpleSoundSpec spec = ndef->get(n).sound_footstep;
m_gamedef->sound()->playSoundAt(spec, false, getPosition()); m_gamedef->sound()->playSoundAt(spec, false, getPosition());