From 38b8816d7bc0d05d21b62c4b859079a438d168c5 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 11 Feb 2018 03:47:29 +1000 Subject: [PATCH] Optimize monster pitch shifting maths a bit --- qcsrc/common/monsters/sv_monsters.qc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; } -- 2.39.2