Don't attempt to scale the world when weapon models are unset.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 19:44:29 +0000 (22:44 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 19:44:29 +0000 (22:44 +0300)
data/qcsrc/server/cl_weaponsystem.qc

index 2b224bac5ad5d766c647f13522d74380289638e2..66ad0f7c587fbef72ec9719f56f0d481bc88a85e 100644 (file)
@@ -740,6 +740,7 @@ void CL_Weaponentity_Think()
 \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
        {\r
                self.weaponentity.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale;\r
                self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weapon_scalefactor_pos");\r
@@ -828,6 +829,7 @@ void CL_ExteriorWeaponentity_Think()
 \r
        // if we are a micro or macro, size the weapon model accordingly\r
        if(self.owner.scale && cvar("g_healthsize_exteriorweapon_scalefactor"))\r
+       if(self.model != "")\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_exteriorweapon_scalefactor")) + cvar("g_healthsize_exteriorweapon_scalefactor") * self.scale;\r