From 183384aaae370c48d8b3e084fa997003c73cc81a Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 2 Aug 2011 15:31:35 +0300 Subject: [PATCH] Allow dead prey to be scaled between 0 and 1 when digested --- data/qcsrc/server/cl_client.qc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 053529e6..16f5bb76 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2312,13 +2312,15 @@ float vercmp(string v1, string v2) void SetPlayerSize() { + // don't scale dead players who aren't prey + if(!self.stat_eaten && self.deadflag != DEAD_NO) + return; + if(cvar("g_healthsize")) { // change player scale based on the amount of health we have self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize"); - if(self.scale < 0.1) - self.scale = 0.1; // stuff breaks if scale is smaller than this // The following code sets the bounding box to match the player's size. // It is currently disabled because of issues with engine movement prediction (cl_movement). @@ -2338,11 +2340,20 @@ void SetPlayerSize() } } - if(self.stat_eaten && cvar("g_vore_neighborprey_distance")) + if(cvar("g_balance_vore_digestion_limit") < 0 && self.deadflag != DEAD_NO && self.stat_eaten) + { + // dead prey must shrink toward zero as they digest, until they reach digestion limit + self.scale *= 1 - bound(0, self.health / cvar("g_balance_vore_digestion_limit"), 1); + } + + if(cvar("g_vore_neighborprey_distance") && self.stat_eaten) { // resize prey if neighborprey is enabled self.scale *= cvar("g_vore_neighborprey_scale"); } + + if(self.scale < 0.1) + self.scale = 0.1; // stuff breaks if scale is smaller than this } void ObserverThink() @@ -2531,9 +2542,10 @@ void PlayerPreThink (void) self.fixangle = TRUE; } + SetPlayerSize(); + if(frametime) { - if(self.health <= 0 && cvar("g_deathglow")) { if(self.glowmod_x > 0) @@ -2690,8 +2702,6 @@ void PlayerPreThink (void) } } - SetPlayerSize(); - FixPlayermodel(); GrabberFrame(); -- 2.39.2