-void Vore_DeadPrey_Configure(entity e)\r
-{\r
- // ran when the keepdeadprey feature is enabled and prey stays inside the stomach after dying\r
-\r
- if(e.fakeprey || !e.stat_eaten) // we already configured everything\r
- return;\r
-\r
- // this entity is like e.predator but for dead prey, to avoid conflicts\r
- e.fakepredator = e.predator;\r
- e.fakeprey = TRUE;\r
- Vore_SetPreyPositions(e.predator);\r
-\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 = world;\r
-\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
-}\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_keepdeadprey"))\r
- return;\r
-\r
- e.fakepredator = world;\r
- e.fakeprey = TRUE; // keep fakeprey status\r
- e.stat_eaten = 0;\r
- e.aiment = world;\r
- e.movetype = MOVETYPE_TOSS;\r
-}\r
-\r
-void Vore_PreyRelease(entity e, float pred_disconnect)\r
-{\r
- if(pred_disconnect)\r
- {\r
- if(e.fakeprey)\r
- Vore_DeadPrey_Detach(e);\r
- else\r
- Vore_Regurgitate(e);\r
- }\r
- else if(self.stat_eaten && !self.fakeprey)\r
- {\r
- // if the keepdeadprey feature is on, don't spit a dead prey's carcass out\r
- if(e.deadflag != DEAD_NO && random() < cvar("g_vore_keepdeadprey"))\r
- Vore_DeadPrey_Configure(e);\r
- else\r
- Vore_Regurgitate(e);\r
- }\r
-}\r
-\r