From 5c760a30e0b462b7b201686a23a43a9243d72887 Mon Sep 17 00:00:00 2001
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Sun, 5 Sep 2010 20:35:07 +0300
Subject: [PATCH] Add a cvar to allow disabling / changing the alpha of the
 stomach model (client side). Mostly a gameplay vs. eye candy player choice.

---
 data/defaultVoretournament.cfg     | 1 +
 data/qcsrc/server/cl_client.qc     | 5 +++++
 data/qcsrc/server/defs.qh          | 1 +
 data/qcsrc/server/miscfunctions.qc | 1 +
 4 files changed, 8 insertions(+)

diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg
index 642e5336..75e29440 100644
--- a/data/defaultVoretournament.cfg
+++ b/data/defaultVoretournament.cfg
@@ -1497,6 +1497,7 @@ set g_triggerimpulse_radial_multiplier 1 "trigger_impulse radial field multiplie
 seta g_ghost_items 1 "enable ghosted items (when between 0 and 1, overrides the alpha value)"
 seta g_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the color unchanged"
 
+set cl_vore_stomachmodel 0.5 "when enabled, we see the stomach model around us when eaten. -1 = disabled, 1 = enabled, anything between 0 and 1 = alpha"
 set g_vore_regurgitatecolor_released "0.75 1 0.5" "the color players will have when released from the stomach alive"
 set g_vore_regurgitatecolor_digested "-0.125 0.25 0" "the color players will have when released from the stomach digested"
 set g_vore_gurglesound 1 "predators make an ambient gurgling sound"
diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc
index 292a37af..11cf27c7 100644
--- a/data/qcsrc/server/cl_client.qc
+++ b/data/qcsrc/server/cl_client.qc
@@ -517,6 +517,8 @@ float Client_customizeentityforclient()
 	if(other.cvar_chase_active > 0 || other.classname == "observer") // the classname check prevents a bug
 	{
 		Client_setmodel(setmodel_state());
+		if not(self.eater.classname == "player")
+			self.alpha = default_player_alpha;
 		return TRUE;
 	}
 	if(other.spectatee_status)
@@ -525,9 +527,12 @@ float Client_customizeentityforclient()
 	{
 		tokenizebyseparator(self.playermodel, ".");
 		Client_setmodel(strcat(argv(0), "_stomach.md3"));
+		self.alpha = other.cvar_cl_vore_stomachmodel;
 		return TRUE;
 	}
 	Client_setmodel(setmodel_state());
+	if not(self.eater.classname == "player")
+		self.alpha = default_player_alpha;
 	return TRUE;
 }
 
diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh
index 88cb559f..6a6a9aa6 100644
--- a/data/qcsrc/server/defs.qh
+++ b/data/qcsrc/server/defs.qh
@@ -333,6 +333,7 @@ float sv_clforceplayermodels;
 .float cvar_cl_gunalign;
 .float cvar_cl_noantilag;
 .float cvar_chase_active;
+.float cvar_cl_vore_stomachmodel;
 
 void Announce(string snd);
 void AnnounceTo(entity e, string snd);
diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc
index 0f6fdcad..65af9b2c 100644
--- a/data/qcsrc/server/miscfunctions.qc
+++ b/data/qcsrc/server/miscfunctions.qc
@@ -615,6 +615,7 @@ void GetCvars(float f)
 	GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_share, "cl_accuracy_data_share");
 	GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_receive, "cl_accuracy_data_receive");
 	GetCvars_handleFloat(s, f, cvar_chase_active, "chase_active");
+	GetCvars_handleFloat(s, f, cvar_cl_vore_stomachmodel, "cl_vore_stomachmodel");
 
 	self.cvar_cl_accuracy_data_share = boolean(self.cvar_cl_accuracy_data_share);
 	self.cvar_cl_accuracy_data_receive = boolean(self.cvar_cl_accuracy_data_receive);
-- 
2.39.5