]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Don't allow player / weapon model scale to go under 0
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 10:44:59 +0000 (13:44 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 10:44:59 +0000 (13:44 +0300)
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_weaponsystem.qc

index 008499388292dfbcbb87373ce7ae513b9182bc60..2b01ef0667d0b657ed9e9b3e7ead0f65cb6b7fc4 100644 (file)
@@ -2317,6 +2317,8 @@ void SetPlayerSize()
                // 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)\r
+                       self.scale = 0.00001; // 0 becomes 1 for scale, so do this to allow almost 0 scale\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
index e76ebbf111e7a4b93cee22eb446d6d2b747f4a11..1434ac32ab42ab15a5c442233c4e3e3c9c6d235c 100644 (file)
@@ -755,10 +755,11 @@ void CL_Weaponentity_Think()
        // create or update the lasertarget entity\r
 \r
        // if we are a micro or macro, size the weapon model accordingly\r
-       if(self.owner.scale && cvar("g_healthsize_weapon_scalefactor"))\r
-       if(self.model != "")\r
+       if(cvar("g_healthsize") && cvar("g_healthsize_weapon_scalefactor"))\r
        {\r
                self.weaponentity.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale;\r
+               if(self.weaponentity.scale <= 0)\r
+                       self.weaponentity.scale = 0.00001; // 0 becomes 1 for scale, so do this to allow almost 0 scale\r
                self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weapon_scalefactor_pos");\r
        }\r
 };\r