From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Sat, 19 Nov 2011 11:48:10 +0000 (+0200)
Subject: Make consumable items possible to regurgitate. Will not work yet as they apply no... 
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8604007574f1ea01c214b156e8c637fa2a828f79;p=voretournament%2Fvoretournament.git

Make consumable items possible to regurgitate. Will not work yet as they apply no stomach load
---

diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg
index 87b80328..2ac1c3ce 100644
--- a/data/defaultVT.cfg
+++ b/data/defaultVT.cfg
@@ -1627,7 +1627,7 @@ set g_vore_regurgitatecolor_color_digest "0.3 0.15 0" "the color players will ha
 set g_vore_regurgitatecolor_fade 0.01 "how quickly the regurgitation color washes off players once they leave the stomach, does not apply to dead bodies"
 set g_vore_regurgitatecolor_particles 0.75 "players who are dirty from regurgitation generate particles this often, based on the amount of goo they have on them"
 set g_vore_neighborprey_distance 4 "Distance by which prey inside the same stomach are positioned away from each other. 0 disables seeing neighboring prey"
-set g_vore_neighborprey_distance_item 4 "Distance by which items inside the same stomach are positioned away from each other. 0 disables seeing neighboring items"
+set g_vore_neighborprey_distance_item 8 "Distance by which items inside the same stomach are positioned away from each other. 0 disables seeing neighboring items"
 set g_vore_swallowmodel_range 100 "Distance by which the swallow model oscillates based on swallow progress"
 
 seta cl_healthsize_fov 0.2 "offset field of view by this amount based on size, to further induce the effect of being large or small"
diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc
index 80116ce8..7987e206 100644
--- a/data/qcsrc/server/t_items.qc
+++ b/data/qcsrc/server/t_items.qc
@@ -219,6 +219,21 @@ void Item_ScheduleInitialRespawn(entity e)
 	Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
 }
 
+void Item_Consumable_Remove();
+void Item_Consumable_Think()
+{
+	if(self.predator.regurgitate_prepare && time > self.predator.regurgitate_prepare)
+	{
+		self.predator.regurgitate_prepare = 0;
+		self.predator.complain_vore = time + complain_delay_time; // prevent complaining the next frame if this empties our stomach
+		Item_Consumable_Remove();
+		return;
+	}
+
+	dprint("!!!!!!!!\n");
+	self.nextthink = time;
+}
+
 float Item_Consumable_Customizeentityforclient()
 {
 	if(cvar("g_vore_neighborprey_distance_item") && self.predator == other.predator && !(other.cvar_chase_active || other.classname == "observer"))
@@ -231,6 +246,13 @@ float Item_Consumable_Customizeentityforclient()
 	return TRUE;
 }
 
+void Item_Consumable_Remove()
+{
+	self.nextthink = 0;
+	remove(self);
+	self = world;
+}
+
 void Item_Consumable_Spawn(entity e, entity pl)
 {
 	entity item;
@@ -250,6 +272,8 @@ void Item_Consumable_Spawn(entity e, entity pl)
 	item.view_ofs_z = CONSUMABLE_VIEW_OFS_z;
 
 	item.customizeentityforclient = Item_Consumable_Customizeentityforclient;
+	item.think = Item_Consumable_Think;
+	item.nextthink = time;
 }
 
 float Item_GiveTo(entity item, entity player)