\r
float Item_Swallow(entity item, entity player)\r
{\r
- float pickedup;\r
+ float pickedup, usage;\r
pickedup = FALSE;\r
+ if(item.dmg && cvar("g_vore"))\r
+ {\r
+ if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
+ if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health)\r
+ usage = 2; // consumable item, only if the vore system is enabled\r
+ }\r
+ else if (player.health < item.max_health)\r
+ usage = 1; // normal item\r
+ if(!usage)\r
+ return FALSE;\r
\r
item.swallow_progress_prey = min(item.swallow_progress_prey + 0.02, 1);\r
+ player.swallow_progress_pred = item.swallow_progress_prey;\r
if(item.swallow_progress_prey < 1)\r
- return FALSE; // item not eaten yet\r
+ return FALSE; // swallow progress not full yet\r
\r
- if(item.dmg && cvar("g_vore")) // consumable item, only if the vore system is enabled\r
+ if(usage > 1)\r
{\r
- if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
- if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health)\r
- {\r
- pickedup = TRUE;\r
- item.swallow_progress_prey = 0;\r
- Item_Consumable_Spawn(item, player);\r
- }\r
+ pickedup = TRUE;\r
+ item.swallow_progress_prey = player.swallow_progress_pred = 0;\r
+ Item_Consumable_Spawn(item, player);\r
}\r
- else if (player.health < item.max_health)\r
+ else\r
{\r
pickedup = TRUE;\r
- item.swallow_progress_prey = 0;\r
+ item.swallow_progress_prey = player.swallow_progress_pred = 0;\r
player.health = min(player.health + item.health, item.max_health);\r
player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));\r
}\r
\r
- player.swallow_progress_pred = item.swallow_progress_prey;\r
return pickedup;\r
}\r
\r