]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Fix some older bugs with the digestion sounds
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:47:21 +0000 (16:47 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:47:21 +0000 (16:47 +0200)
data/qcsrc/server/vore.qc

index e07db746bd17ca29af2907bbc86d7b5e45ea0160..d7f55b966172449953f215208f1484284e067fe7 100644 (file)
@@ -137,7 +137,7 @@ void Vore_SetPreyPositions(entity pred)
 .float gurgle_oldstomachload;\r
 void Vore_GurgleSound()\r
 {\r
-       if(time > self.gurglesound_finished || self.gurgle_oldstomachload != self.stomach_load)\r
+       if(time > self.gurglesound_finished || (self.gurgle_oldstomachload != self.stomach_load && !self.digesting))\r
        {\r
                GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE);\r
 \r
@@ -429,9 +429,9 @@ void Vore_Disconnect()
                if(head.predator == self)\r
                        Vore_Regurgitate(head);\r
        }\r
-       Vore_GurgleSound(); // stop the gurgling sound\r
 \r
        self.stomach_load = self.gravity = 0; // prevents a bug\r
+       Vore_GurgleSound(); // stop the gurgling sound\r
 }\r
 \r
 .float digestion_step;\r
@@ -467,11 +467,6 @@ void Vore_Digest()
                if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
                        self.predator.health += damage * cvar("g_balance_vore_digestion_vampire");\r
 \r
-               if (self.predator.digestsound_finished < time)\r
-               {\r
-                       PlayerSound (self.predator, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);\r
-                       self.predator.digestsound_finished = time + 0.5;\r
-               }\r
                self.digestion_step = time + vore_steptime;\r
        }\r
 \r
@@ -813,6 +808,11 @@ void Vore()
                return;\r
        }\r
 \r
+       if (self.digesting && self.digestsound_finished < time)\r
+       {\r
+               PlayerSound (self, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);\r
+               self.digestsound_finished = time + 0.5;\r
+       }\r
        if(cvar("g_vore_gurglesound"))\r
                Vore_GurgleSound();\r
 \r