From: Mario Date: Sat, 10 Feb 2018 17:47:29 +0000 (+1000) Subject: Optimize monster pitch shifting maths a bit X-Git-Tag: xonotic-v0.8.5~2329 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38b8816d7bc0d05d21b62c4b859079a438d168c5;p=xonotic%2Fxonotic-data.pk3dir.git Optimize monster pitch shifting maths a bit --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 15fba0134..9dffeb73e 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -339,9 +339,8 @@ void Monster_Sound(entity this, .string samplefield, float sound_delay, bool del string sample = this.(samplefield); if (sample != "") sample = GlobalSound_sample(sample, random()); float myscale = ((this.scale) ? this.scale : 1); // safety net - float scale_inverse = 1 / myscale; // TODO: change volume depending on size too? - sound7(this, chan, sample, VOL_BASE, ATTEN_NORM, scale_inverse * 100, 0); + sound7(this, chan, sample, VOL_BASE, ATTEN_NORM, 100 / myscale, 0); this.msound_delay = time + sound_delay; }