{\r
// ran when the fulldigest feature is enabled and prey stays inside the stomach after dying\r
\r
- if(e.fakepredator.classname == "player" || e.predator.classname != "player")\r
+ if(e.fakepredator.classname == "player" || e.predator.classname != "player") // already configured\r
return;\r
\r
- // this entity is pretty much like e.predator but for dead prey, to avoid some conflicts\r
+ // this entity is like e.predator but for dead prey, to avoid conflicts\r
e.fakepredator = e.predator;\r
\r
- // first release the prey from the predator, as dead prey needs to be attached to predators differently\r
- // the predator's stomach load is also decreased, as our dead prey doesn't count as actual prey any more\r
+ // first release the prey from the predator, as dead prey needs to be attached differently\r
+ // the predator's stomach load is also decreased, as dead prey doesn't count any more\r
e.predator.stomach_load -= 1;\r
Vore_Weight_apply(e.predator);\r
e.predator = world;\r
\r
- // now, keep our dead prey inside the predator's stomach\r
+ // now put our dead prey inside the predator's stomach, but only as an effect\r
e.movetype = MOVETYPE_FOLLOW;\r
e.takedamage = DAMAGE_NO;\r
e.solid = SOLID_NOT;\r
e.aiment = e.fakepredator;\r
- // completely hide the dead body\r
+\r
+ // completely remove the dead body\r
e.alpha = -1;\r
setmodel(e, "");\r
}\r
void Vore_DeadPrey_Detach(entity e)\r
{\r
// ran when dead prey must be detached from the stomach (eg: they are respawning)\r
+ // should only execute after Vore_DeadPrey_Configure has ran first\r
+\r
+ if not(cvar("g_vore_fulldigest"))\r
+ return;\r
\r
e.fakepredator = world;\r
e.aiment = world;\r
}\r
\r
-void Vore_ChoosePreyRelease(entity e)\r
+void Vore_PreyRelease(entity e)\r
{\r
- // if the fulldigest feature is on, we don't spit a dead prey's carcass out\r
+ // if the fulldigest feature is on, don't spit a dead prey's carcass out\r
if(e.health <= 0 && cvar("g_vore_fulldigest"))\r
+ {\r
Vore_DeadPrey_Configure(e);\r
+\r
+ // if fulldigest is enabled and the predator is dead or disconnected, detach the dead prey from him\r
+ if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO)\r
+ Vore_DeadPrey_Detach(self);\r
+ }\r
else\r
Vore_Regurgitate(e);\r
}\r
\r
// prey disconnects or goes spectating while inside someone's belly\r
if(self.predator.classname == "player")\r
- Vore_ChoosePreyRelease(self);\r
+ Vore_PreyRelease(self);\r
\r
// pred disconnects or goes spectating with players in their belly\r
else if(self.stomach_load > 0)\r
FOR_EACH_PLAYER(head)\r
{\r
if(head.predator == self)\r
- Vore_ChoosePreyRelease(head);\r
+ Vore_PreyRelease(head);\r
}\r
Vore_Gurglesound(); // stop the gurgling sound\r
}\r
\r
if(self.deadflag)\r
{\r
- Vore_ChoosePreyRelease(self);\r
-\r
- // if the predator's dead, we detach the dead prey from him\r
- if(self.fakepredator.classname != "player" || self.fakepredator.deadflag != DEAD_NO)\r
- Vore_DeadPrey_Detach(self);\r
-\r
+ Vore_PreyRelease(self);\r
return;\r
}\r
\r