]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Allow dead prey to be scaled between 0 and 1 when digested
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 12:31:35 +0000 (15:31 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 12:31:35 +0000 (15:31 +0300)
data/qcsrc/server/cl_client.qc

index 053529e67794457633a2bedc8cd0e01a421da064..16f5bb76fa5e7628663f1fa17b17f72d626a16bd 100644 (file)
@@ -2312,13 +2312,15 @@ float vercmp(string v1, string v2)
 \r
 void SetPlayerSize()\r
 {\r
+       // don't scale dead players who aren't prey\r
+       if(!self.stat_eaten && self.deadflag != DEAD_NO)\r
+               return;\r
+\r
        if(cvar("g_healthsize"))\r
        {\r
                // change player scale based on the amount of health we have\r
 \r
                self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize");\r
-               if(self.scale < 0.1)\r
-                       self.scale = 0.1; // stuff breaks if scale is smaller than this\r
 \r
                // The following code sets the bounding box to match the player's size.\r
                // It is currently disabled because of issues with engine movement prediction (cl_movement).\r
@@ -2338,11 +2340,20 @@ void SetPlayerSize()
                }\r
        }\r
 \r
-       if(self.stat_eaten && cvar("g_vore_neighborprey_distance"))\r
+       if(cvar("g_balance_vore_digestion_limit") < 0 && self.deadflag != DEAD_NO && self.stat_eaten)\r
+       {\r
+               // dead prey must shrink toward zero as they digest, until they reach digestion limit\r
+               self.scale *= 1 - bound(0, self.health / cvar("g_balance_vore_digestion_limit"), 1);\r
+       }\r
+\r
+       if(cvar("g_vore_neighborprey_distance") && self.stat_eaten)\r
        {\r
                // resize prey if neighborprey is enabled\r
                self.scale *= cvar("g_vore_neighborprey_scale");\r
        }\r
+\r
+       if(self.scale < 0.1)\r
+               self.scale = 0.1; // stuff breaks if scale is smaller than this\r
 }\r
 \r
 void ObserverThink()\r
@@ -2531,9 +2542,10 @@ void PlayerPreThink (void)
                        self.fixangle = TRUE;\r
                }\r
 \r
+               SetPlayerSize();\r
+\r
                if(frametime)\r
                {\r
-\r
                        if(self.health <= 0 && cvar("g_deathglow"))\r
                        {\r
                                if(self.glowmod_x > 0)\r
@@ -2690,8 +2702,6 @@ void PlayerPreThink (void)
                        }\r
                }\r
 \r
-               SetPlayerSize();\r
-\r
                FixPlayermodel();\r
 \r
                GrabberFrame();\r