The exterior weapon entity will now scale properly as well
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 16:32:03 +0000 (19:32 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 16:32:03 +0000 (19:32 +0300)
data/qcsrc/server/cl_weaponsystem.qc

index 78c92e1a410604c23ec2e47f805a67bd030953f6..034b4fc7933e9a946ff41bb9613dd845e3b30be6 100644 (file)
@@ -736,15 +736,14 @@ void CL_Weaponentity_Think()
 \r
        }\r
 \r
+       // 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_weaponscalefactor"))\r
        {\r
                self.weaponentity.scale = (1 + cvar("g_healthsize_weaponscalefactor")) - cvar("g_healthsize_weaponscalefactor") * self.owner.scale;\r
                self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weaponscalefactor_viewmodel_pos");\r
-               dprint(strcat(ftos(self.weaponentity.origin_z), "\n"));\r
        }\r
-\r
-       // create or update the lasertarget entity\r
 };\r
 \r
 void CL_ExteriorWeaponentity_Think()\r
@@ -827,6 +826,13 @@ void CL_ExteriorWeaponentity_Think()
                self.angles = ang;\r
        }\r
 \r
+       // if we are a micro or macro, size the weapon model accordingly\r
+       if(self.owner.scale && cvar("g_healthsize_weaponscalefactor"))\r
+       {\r
+               self.scale = 1 / self.owner.scale; // for some reason, the exterior weapon entity copies the player's scale somewhere else, so undo that first\r
+               self.scale = (1 - cvar("g_healthsize_weaponscalefactor")) + cvar("g_healthsize_weaponscalefactor") * self.scale;\r
+       }\r
+\r
        self.colormap = self.owner.colormap;\r
        self.customizeentityforclient = CL_ExteriorWeaponentity_CustomizeEntityForClient;\r
 };\r