m_initial_tx_basepos_set = true;
m_tx_basepos = m_prop.initial_sprite_basepos;
}
+ if (m_is_local_player) {
+ LocalPlayer *player = m_env->getLocalPlayer();
+ player->makes_footstep_sound = m_prop.makes_footstep_sound;
+ }
if ((m_is_player && !m_is_local_player) && m_prop.nametag == "")
m_prop.nametag = m_name;
ISoundManager *m_sound;
INodeDefManager *m_ndef;
public:
+ bool makes_footstep_sound;
float m_player_step_timer;
SimpleSoundSpec m_player_step_sound;
SoundMaker(ISoundManager *sound, INodeDefManager *ndef):
m_sound(sound),
m_ndef(ndef),
+ makes_footstep_sound(true),
m_player_step_timer(0)
{
}
{
if (m_player_step_timer <= 0 && m_player_step_sound.exists()) {
m_player_step_timer = 0.03;
- m_sound->playSound(m_player_step_sound, false);
+ if (makes_footstep_sound)
+ m_sound->playSound(m_player_step_sound, false);
}
}
camera->getCameraNode()->getUpVector());
sound->setListenerGain(g_settings->getFloat("sound_volume"));
+ LocalPlayer *player = client->getEnv().getLocalPlayer();
- // Update sound maker
- soundmaker->step(dtime);
+ // Tell the sound maker whether to make footstep sounds
+ soundmaker->makes_footstep_sound = player->makes_footstep_sound;
- LocalPlayer *player = client->getEnv().getLocalPlayer();
+ // Update sound maker
+ if (player->makes_footstep_sound)
+ soundmaker->step(dtime);
ClientMap &map = client->getEnv().getClientMap();
MapNode n = map.getNodeNoEx(player->getFootstepNodePos());