Skip to content

Commit ee0bfbe

Browse files
committed
CAO footstep sounds: Reduce gain to balance volume
1 parent e2afcf8 commit ee0bfbe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/content_cao.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -862,16 +862,17 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
862862

863863
float moved = lastpos.getDistanceFrom(pos_translator.vect_show);
864864
m_step_distance_counter += moved;
865-
if(m_step_distance_counter > 1.5*BS)
866-
{
867-
m_step_distance_counter = 0;
868-
if(!m_is_local_player && m_prop.makes_footstep_sound)
869-
{
865+
if (m_step_distance_counter > 1.5f * BS) {
866+
m_step_distance_counter = 0.0f;
867+
if (!m_is_local_player && m_prop.makes_footstep_sound) {
870868
INodeDefManager *ndef = m_client->ndef();
871-
v3s16 p = floatToInt(getPosition() + v3f(0,
872-
(m_prop.collisionbox.MinEdge.Y-0.5)*BS, 0), BS);
869+
v3s16 p = floatToInt(getPosition() +
870+
v3f(0.0f, (m_prop.collisionbox.MinEdge.Y - 0.5f) * BS, 0.0f), BS);
873871
MapNode n = m_env->getMap().getNodeNoEx(p);
874872
SimpleSoundSpec spec = ndef->get(n).sound_footstep;
873+
// Reduce footstep gain, as non-local-player footsteps are
874+
// somehow louder.
875+
spec.gain *= 0.6f;
875876
m_client->sound()->playSoundAt(spec, false, getPosition());
876877
}
877878
}

0 commit comments

Comments
 (0)