}\r
}\r
\r
+void Vore_AutoDigest(entity e)\r
+{\r
+ // if the predator has the autodigest preference enabled, begin digesting new prey automatically\r
+\r
+ if(!cvar("g_vore_digestion") || e.digesting)\r
+ return;\r
+ if(clienttype(e) != CLIENTTYPE_REAL)\r
+ return; // this feature is only for players, not bots\r
+ if(e.stomach_load)\r
+ return; // don't start digestion if we already ate someone, as that means we manually disabled it after the first prey and want it off\r
+ if(Stomach_TeamMates_check(e))\r
+ return; // never begin automatic digestion if we've swallowed a team mate\r
+\r
+ e.digesting = TRUE;\r
+}\r
+\r
void Vore_StomachLoad_Apply()\r
{\r
// apply stomach weight that makes you heavier and larger the more you eat\r
if(cvar("g_healthsize"))\r
prey_mass *= e.scale;\r
self.stomach_load += ceil(prey_mass);\r
+ if(self.cvar_cl_vore_autodigest > 1)\r
+ Vore_AutoDigest(self);\r
}\r
}\r
for(e = world; (e = find(e, classname, "consumable")); )\r
{\r
if(e.predator == self)\r
+ {\r
self.stomach_load += ceil(e.dmg);\r
+ if(self.cvar_cl_vore_autodigest > 0)\r
+ Vore_AutoDigest(self);\r
+ }\r
}\r
\r
// apply weight\r
self.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity\r
}\r
\r
-void Vore_AutoDigest(entity e)\r
-{\r
- // if the predator has the autodigest preference enabled, begin digesting new prey automatically\r
-\r
- if(!cvar("g_vore_digestion") || e.digesting)\r
- return;\r
- if(!e.cvar_cl_vore_autodigest || clienttype(e) != CLIENTTYPE_REAL)\r
- return; // this feature is only for players, not bots\r
- if(e.stomach_load)\r
- return; // don't start digestion if we already ate someone, as that means we manually disabled it after the first prey and want it off\r
- if(Stomach_TeamMates_check(e))\r
- return; // never begin automatic digestion if we've swallowed a team mate\r
-\r
- e.digesting = TRUE;\r
-}\r
-\r
.entity swallow_model;\r
float Vore_SwallowModel_CustomizeEntityForClient()\r
{\r
e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them\r
Vore_SetPreyPositions(e.predator);\r
- if(e.predator.cvar_cl_vore_autodigest > 1)\r
- Vore_AutoDigest(e.predator);\r
\r
// block firing for a small amount of time, or we'll be firing the next frame after we swallow\r
e.predator.weapon_delay = time + button_delay_time;\r