From 1b2014703fea4a3c14e2c798bd26dcbdbc4a74fc Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 2 Aug 2011 13:51:39 +0300 Subject: [PATCH] Don't allow scale to be smaller than 0.1, since that breaks stuff --- data/qcsrc/server/cl_client.qc | 4 ++-- data/qcsrc/server/cl_weaponsystem.qc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 2b01ef06..053529e6 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2317,8 +2317,8 @@ void SetPlayerSize() // 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) - self.scale = 0.00001; // 0 becomes 1 for scale, so do this to allow almost 0 scale + 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). diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index 1434ac32..56720794 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -758,8 +758,8 @@ void CL_Weaponentity_Think() if(cvar("g_healthsize") && cvar("g_healthsize_weapon_scalefactor")) { self.weaponentity.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale; - if(self.weaponentity.scale <= 0) - self.weaponentity.scale = 0.00001; // 0 becomes 1 for scale, so do this to allow almost 0 scale + if(self.weaponentity.scale < 0.1) + self.weaponentity.scale = 0.1; // stuff breaks if scale is smaller than this self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weapon_scalefactor_pos"); } }; -- 2.39.2