]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Make gib sound volume dependent on gib size
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 14:40:51 +0000 (17:40 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 14:40:51 +0000 (17:40 +0300)
data/qcsrc/client/gibs.qc

index 12a077530fe376b333703a422ae07d474a580913..3e228f648b05c801a173e90e95341f87d8bb05d2 100644 (file)
@@ -72,7 +72,15 @@ void Gib_Touch()
        }\r
 \r
        if(!self.silent)\r
-               sound(self, CHAN_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTN_NORM);\r
+       {\r
+               float vol;\r
+               vol = VOL_BASE;\r
+               if(self.scale) // sound volume dependent on gib size\r
+                       vol *= self.scale;\r
+               vol = bound(0, vol, 1);\r
+\r
+               sound(self, CHAN_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), vol, ATTN_NORM);\r
+       }\r
        pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);\r
 \r
        Gib_Delete();\r
@@ -188,7 +196,15 @@ void Ent_GibSplash(float isNew)
        {\r
                case 0x01:\r
                        if(!issilent)\r
-                               sound (self, CHAN_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);\r
+                       {\r
+                               float vol;\r
+                               vol = VOL_BASE;\r
+                               if(sz) // sound volume dependent on gib size\r
+                                       vol *= sz;\r
+                               vol = bound(0, vol, 1);\r
+\r
+                               sound (self, CHAN_PAIN, "misc/gib.wav", vol, ATTN_NORM);\r
+                       }\r
 \r
                        if(prandom() < amount)\r
                                TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, sz, 0, issilent);\r