From 3bdede506608b205b2a7cd32d1b70c5d21367559 Mon Sep 17 00:00:00 2001
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Sat, 19 Nov 2011 20:15:04 +0200
Subject: [PATCH] Fix an epic failure in a recent commit. Digestion damage
 working properly again

---
 data/balanceVT.cfg           | 2 +-
 data/qcsrc/server/t_items.qc | 5 +++--
 data/qcsrc/server/vore.qc    | 5 +++--
 docs/Release notes.txt       | 2 --
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg
index 31140e9b..55d1f071 100644
--- a/data/balanceVT.cfg
+++ b/data/balanceVT.cfg
@@ -218,7 +218,7 @@ set g_balance_vore_regurgitate_predator_punchangle_item 6 "your view gets tilted
 set g_balance_vore_regurgitate_prey_punchvector 50 "your view gets lowered by this amount when getting regurgitated"
 set g_balance_vore_digestion_damage 4 "amount of damage applied to victims during digestion"
 set g_balance_vore_digestion_damage_death 2 "amplify digestion damage by this amount when the prey is dead"
-set g_balance_vore_digestion_damage_item 2 "amount of damage applied to items during digestion"
+set g_balance_vore_digestion_damage_item 1 "amount of damage applied to items during digestion"
 set g_balance_vore_digestion_limit -100 "prey can be digested down to this amount of health"
 set g_balance_vore_digestion_limit_regurgitate 1 "the predator automatically regurgitates prey that has reached the digestion limit"
 set g_balance_vore_digestion_limit_blockrespawn 1 "dead prey cannot respawn if it's still being digested"
diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc
index 559fa572..4ec0ed2a 100644
--- a/data/qcsrc/server/t_items.qc
+++ b/data/qcsrc/server/t_items.qc
@@ -256,8 +256,9 @@ void Item_Consumable_Think()
 
 			damage_offset = 1;
 			if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage
-				damage_offset /= self.predator.stomach_load / self.predator.stomach_maxload;
-			damage = ceil(cvar("g_balance_vore_digestion_damage_item") / damage_offset);
+				damage_offset *= self.predator.stomach_load / self.predator.stomach_maxload;
+			damage_offset = ceil(damage_offset);
+			damage = cvar("g_balance_vore_digestion_damage_item") / damage_offset;
 
 			self.health -= damage;
 			if(self.predator.health + damage <= self.max_health)
diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc
index 2a5e7387..300dfc73 100644
--- a/data/qcsrc/server/vore.qc
+++ b/data/qcsrc/server/vore.qc
@@ -459,11 +459,12 @@ void Vore_Digest()
 
 		damage_offset = 1;
 		if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage
-			damage_offset /= self.predator.stomach_load / self.predator.stomach_maxload;
+			damage_offset *= self.predator.stomach_load / self.predator.stomach_maxload;
 		if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff")) // apply player scale to digestion damage
 			damage_offset *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_digestion_scalediff"));
+		damage_offset = ceil(damage_offset);
 
-		damage = ceil(cvar("g_balance_vore_digestion_damage") / damage_offset);
+		damage = cvar("g_balance_vore_digestion_damage") / damage_offset;
 		if(cvar("g_balance_vore_digestion_damage_death") && self.deadflag != DEAD_NO) // amplify digestion damage for dead prey
 			damage *= cvar("g_balance_vore_digestion_damage_death");
 
diff --git a/docs/Release notes.txt b/docs/Release notes.txt
index 617d5f01..5e839cad 100644
--- a/docs/Release notes.txt	
+++ b/docs/Release notes.txt	
@@ -266,8 +266,6 @@ Bug fixes:
 
 - Prevent bots switching to weapons they don't own in order to reload them, causing weird animations.
 
-- Correct a bug that caused distributed digestion to work in reverse, and amplify instead of reducing.
-
 - Fix health rot not pausing when gaining health from digestion.
 
 Features:
-- 
2.39.5