Fix view offset with prey at different sizes.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 01:39:09 +0000 (04:39 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 01:39:09 +0000 (04:39 +0300)
data/qcsrc/server/cl_client.qc

index 675c757df9c0f163790bffd128f1dd2b41920ab9..2ae048dbc8cd968a62fa56d7a3e958c7b84094b4 100644 (file)
@@ -2251,21 +2251,29 @@ void ApplyHealthSize()
        if not(cvar("g_healthsize"))\r
                return;\r
 \r
-       self.scale = self.health / 100; // ranges between 0 and 100\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
-       // The engine expects the bounding box to be default size, and changing it will cause glitches.\r
-       // This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction.\r
-       if(self.crouch)\r
+       if(self.predator.classname == "player" || self.fakeprey)\r
        {\r
-               //setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);\r
-               self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;\r
+               self.view_ofs = PL_CROUCH_VIEW_OFS * self.predator.scale;\r
+               self.scale = 0;\r
        }\r
        else\r
        {\r
-               //setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);\r
-               self.view_ofs = PL_VIEW_OFS * self.scale;\r
+               self.scale = self.health / 100; // ranges between 0 and 100\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
+               // The engine expects the bounding box to be default size, and changing it will cause glitches.\r
+               // This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction.\r
+               if(self.crouch)\r
+               {\r
+                       //setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);\r
+                       self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;\r
+               }\r
+               else\r
+               {\r
+                       //setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);\r
+                       self.view_ofs = PL_VIEW_OFS * self.scale;\r
+               }\r
        }\r
 }\r
 \r