From: FruitieX Date: Sat, 4 Dec 2010 12:11:54 +0000 (+0200) Subject: reset the weapon glowmod each frame before the WR_THINK function, let WR_THINK functi... X-Git-Tag: xonotic-v0.1.0preview~65^2~5^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=62bebaf30849a5415958d844237e182246a36aeb;p=xonotic%2Fxonotic-data.pk3dir.git reset the weapon glowmod each frame before the WR_THINK function, let WR_THINK function eventually set it --- diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 5b765396c..6daf741fb 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -389,7 +389,9 @@ void W_WeaponFrame() v_forward = fo; v_right = ri; v_up = up; + self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset glowmod, weapon think function only *might* set it weapon_action(self.weapon, WR_THINK); + self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod; // exterior weaponmodel has the same glowmod } if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink) { diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 6e3210859..7d5b76920 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -96,11 +96,9 @@ float w_nex(float req) if(cvar("g_balance_nex_charge")) { - self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset - - self.weaponentity.weaponentity.glowmod_x = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); - self.weaponentity.weaponentity.glowmod_y = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); - self.weaponentity.weaponentity.glowmod_z = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_half") * bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_x = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_half") * bound(0, self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_y = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_half") * bound(0, self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); + self.weaponentity.weaponentity.glowmod_z = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_half") * bound(0, self.nex_charge / cvar("g_balance_nex_charge_limit"), 1); if(self.nex_charge > cvar("g_balance_nex_charge_limit")) { @@ -108,7 +106,6 @@ float w_nex(float req) self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit")); } - self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod; } if(cvar("g_balance_nex_secondary_charge_pool"))