]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix distributed digestion
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 13:59:29 +0000 (16:59 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 13:59:29 +0000 (16:59 +0300)
data/qcsrc/server/vore.qc

index d540bedac5842238d3c93bbfae010a4f31a8741d..37d620745734cab110511a26f95e5df569a9b1dd 100644 (file)
@@ -512,18 +512,16 @@ void Vore_Digest()
        {\r
                // if distributed digestion is enabled, reduce digestion strength by the amount of prey in our stomach\r
                float vore_offset;\r
-               if(cvar("g_balance_vore_digestion_distribute"))\r
-                       vore_offset = self.predator.stomach_maxload / self.predator.stomach_load;\r
-               else\r
-                       vore_offset = 1;\r
+               vore_offset = 1;\r
+               if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage\r
+                       vore_offset *= self.predator.stomach_load / self.predator.stomach_maxload;\r
+               if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff")) // apply player scale to digestion damage\r
+                       vore_offset *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_digestion_scalediff"));\r
+               vore_offset = ceil(vore_offset);\r
 \r
                float damage;\r
                damage = cvar("g_balance_vore_digestion_damage") / vore_offset;\r
 \r
-               // apply player scale to digestion damage\r
-               if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff"))\r
-                       damage *= pow(self.predator.scale / self.scale, cvar("g_balance_vore_digestion_scalediff"));\r
-\r
                Damage(self, self.predator, self.predator, damage, DEATH_DIGESTION, self.origin, '0 0 0');\r
                if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
                        self.predator.health += cvar("g_balance_vore_digestion_vampire") / vore_offset;\r