return vercmp_recursive(v1, v2);\r
}\r
\r
+.float last_alive_scale;\r
void SetPlayerSize()\r
{\r
if(!cvar("g_healthsize"))\r
return;\r
\r
- // change player scale based on the amount of health we have\r
- self.scale = pow(bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize_center"), cvar("g_healthsize"));\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.deadflag == DEAD_NO)\r
{\r
- //setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);\r
- if(!self.stat_eaten)\r
- self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;\r
+ // change player scale based on the amount of health we have\r
+ self.scale = pow(bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize_center"), cvar("g_healthsize"));\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
+ if(!self.stat_eaten)\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
+ if(!self.stat_eaten)\r
+ self.view_ofs = PL_VIEW_OFS * self.scale;\r
+ }\r
+\r
+ self.last_alive_scale = self.scale;\r
}\r
- else\r
+ else if(self.last_alive_scale)\r
{\r
- //setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);\r
- if(!self.stat_eaten)\r
- self.view_ofs = PL_VIEW_OFS * self.scale;\r
+ // if the player is dead, use the last scale he had when he was alive\r
+ self.scale = self.last_alive_scale;\r
}\r
\r
if(cvar("g_healthsize_death") && self.deadflag != DEAD_NO)\r