From: MirceaKitsune Date: Wed, 1 Feb 2012 11:49:44 +0000 (+0200) Subject: Improve a formula for my last commit X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=753773e6b22e75cd8bbdb1feb2608615a62684be;p=voretournament%2Fvoretournament.git Improve a formula for my last commit --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index de559885..ffed64ea 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1657,7 +1657,7 @@ set g_healthsize_viewfactor 2 "The view is offset by this amount based on player set g_healthsize_soundfactor 0.5 "The sounds players make are amplified or reduced by this amount based on their size" set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resizes the exterior weapon model" set g_healthsize_weapon_scalefactor 1 "Amount by which player size resizes the view weapon model" -set g_healthsize_weapon_scalefactor_pos 4 "Amount by which the view model is moved vertically based on player size" +set g_healthsize_weapon_scalefactor_pos 6 "Amount by which the view model is moved vertically based on player size" set g_power 5 "when armor is below this level, the HUD, crosshair and helper will not work" set g_power_reboot 2 "amount of time it takes to boot a player's subsystems once he has enough armor" diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index e9e06ec0..100c4f8f 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -757,9 +757,9 @@ void CL_Weaponentity_Think() // if we are a micro or macro, size the weapon model accordingly if(cvar("g_healthsize") && cvar("g_healthsize_weapon_scalefactor")) - if(self.model != "") + if(self.owner.scale) // prevents some exceptions { - self.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale; + self.scale = pow(1 / self.owner.scale, cvar("g_healthsize_weapon_scalefactor")); if(self.scale < 0.1) self.scale = 0.1; // stuff breaks if scale is smaller than this self.origin_z = (1 - self.scale) * cvar("g_healthsize_weapon_scalefactor_pos");