aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-09-19 16:39:30 +0100
committerSmallJoker <mk939@ymail.com>2018-06-03 17:31:59 +0200
commit6b0fb94d60f7ddd7345d9bf526733c125ea95397 (patch)
treecb2e00dd07a350f6641361da84f9c5f658954033
parent017815161b8583c07f0636dcfa05d654acbdfacd (diff)
downloadminetest-6b0fb94d60f7ddd7345d9bf526733c125ea95397.tar.gz
minetest-6b0fb94d60f7ddd7345d9bf526733c125ea95397.tar.bz2
minetest-6b0fb94d60f7ddd7345d9bf526733c125ea95397.zip
CAO footstep sounds: Reduce gain to balance volume
-rw-r--r--src/content_cao.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index d15c53e7a..e90bb90ca 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -1184,16 +1184,17 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
float moved = lastpos.getDistanceFrom(pos_translator.vect_show);
m_step_distance_counter += moved;
- if(m_step_distance_counter > 1.5*BS)
- {
- m_step_distance_counter = 0;
- if(!m_is_local_player && m_prop.makes_footstep_sound)
- {
+ if (m_step_distance_counter > 1.5f * BS) {
+ m_step_distance_counter = 0.0f;
+ if (!m_is_local_player && m_prop.makes_footstep_sound) {
INodeDefManager *ndef = m_client->ndef();
- v3s16 p = floatToInt(getPosition() + v3f(0,
- (m_prop.collisionbox.MinEdge.Y-0.5)*BS, 0), BS);
+ v3s16 p = floatToInt(getPosition() +
+ v3f(0.0f, (m_prop.collisionbox.MinEdge.Y - 0.5f) * BS, 0.0f), BS);
MapNode n = m_env->getMap().getNodeNoEx(p);
SimpleSoundSpec spec = ndef->get(n).sound_footstep;
+ // Reduce footstep gain, as non-local-player footsteps are
+ // somehow louder.
+ spec.gain *= 0.6f;
m_client->sound()->playSoundAt(spec, false, getPosition());
}
}