]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Make each digesting item to grant health up to its max_health level only
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 15:54:04 +0000 (17:54 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 15:54:04 +0000 (17:54 +0200)
data/qcsrc/server/t_items.qc

index 975ea4ffdae9fc5b667497fd5c7f218a1f55ffc2..b43d4f696ae4d758e99b7191008ca105f70e53ce 100644 (file)
@@ -260,7 +260,10 @@ void Item_Consumable_Think()
                        damage = ceil(cvar("g_balance_vore_digestion_damage_item") / damage_offset);\r
 \r
                        self.health -= damage;\r
-                       self.predator.health += damage;\r
+                       if(self.predator.health + damage <= self.max_health)\r
+                               self.predator.health += damage;\r
+                       else if(self.predator.health < self.max_health)\r
+                               self.predator.health = self.max_health;\r
                        self.predator.pauserothealth_finished = max(self.predator.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));\r
 \r
                        self.item_digestion_step = time + vore_steptime;\r