From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Tue, 3 May 2011 22:56:17 +0000 (+0300)
Subject: Allow scaling prey down when the neighboring prey feature is enable. Don't enable... 
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2618787aae8e7ed03c7c01ad48964296054d96ad;p=voretournament%2Fvoretournament.git

Allow scaling prey down when the neighboring prey feature is enable. Don't enable it by default yet though.
---

diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg
index 3a56068a..575d34c7 100644
--- a/data/defaultVT.cfg
+++ b/data/defaultVT.cfg
@@ -1565,6 +1565,7 @@ set g_vore_regurgitatecolor_release_fade 0.01 "how quickly the regurgitation col
 set g_vore_regurgitatecolor_digest "0.15 0.25 0" "the color players will have when digested, only works when g_vore_keepdeadprey is disabled"
 set g_vore_keepdeadprey 0.75 "If enabled, prey remains in the stomach after dying, else the predator throws up their dead body. 0 = disabled, 1 = ernabled, anything between = probability"
 set g_vore_neighborprey_distance 16 "Distance by which prey inside the same stomach are positioned away from each other. 0 disables seeing neighboring prey"
+set g_vore_neighborprey_scale 1 "When neighborprey is enabled, all prey is resized by this amount"
 
 set g_healthsize 100 "Players who are low on health shrink and become smaller, value specifies health at which the player has default size"
 set g_healthsize_movementfactor 0.5 "Amount by which player size affects jumping and running"
diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc
index e954308e..33a00182 100644
--- a/data/qcsrc/server/cl_client.qc
+++ b/data/qcsrc/server/cl_client.qc
@@ -2277,30 +2277,36 @@ float vercmp(string v1, string v2)
 	return vercmp_recursive(v1, v2);
 }
 
-void ApplyHealthSize()
+void SetPlayerSize()
 {
-	// change player scale based on the amount of health we have
-
-	if not(cvar("g_healthsize"))
-		return;
+	if(cvar("g_healthsize"))
+	{
+		// change player scale based on the amount of health we have
 
-	self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize");
+		self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize");
 
-	// The following code sets the bounding box to match the player's size.
-	// It is currently disabled because of issues with engine movement prediction (cl_movement).
-	// The engine expects the bounding box to be default size, and changing it will cause glitches.
-	// This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction.
-	if(self.crouch)
-	{
-		//setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);
-		if(!self.stat_eaten)
-			self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;
+		// The following code sets the bounding box to match the player's size.
+		// It is currently disabled because of issues with engine movement prediction (cl_movement).
+		// The engine expects the bounding box to be default size, and changing it will cause glitches.
+		// This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction.
+		if(self.crouch)
+		{
+			//setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);
+			if(!self.stat_eaten)
+				self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;
+		}
+		else
+		{
+			//setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);
+			if(!self.stat_eaten)
+				self.view_ofs = PL_VIEW_OFS * self.scale;
+		}
 	}
-	else
+
+	if(self.stat_eaten && cvar("g_vore_neighborprey_distance"))
 	{
-		//setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);
-		if(!self.stat_eaten)
-			self.view_ofs = PL_VIEW_OFS * self.scale;
+		// resize prey
+		self.scale *= cvar("g_vore_neighborprey_scale");
 	}
 }
 
@@ -2626,7 +2632,7 @@ void PlayerPreThink (void)
 			}
 		}
 
-		ApplyHealthSize();
+		SetPlayerSize();
 
 		FixPlayermodel();