reset the weapon glowmod each frame before the WR_THINK function, let WR_THINK functi...
authorFruitieX <fruitiex@gmail.com>
Sat, 4 Dec 2010 12:11:54 +0000 (14:11 +0200)
committerFruitieX <fruitiex@gmail.com>
Sat, 4 Dec 2010 12:11:54 +0000 (14:11 +0200)
qcsrc/server/cl_weapons.qc
qcsrc/server/w_nex.qc

index 5b76539..6daf741 100644 (file)
@@ -389,7 +389,9 @@ void W_WeaponFrame()
                        v_forward = fo;
                        v_right = ri;
                        v_up = up;
                        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);
                        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)
                {
                }
                if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
                {
index 6e32108..7d5b769 100644 (file)
@@ -96,11 +96,9 @@ float w_nex(float req)
 
         if(cvar("g_balance_nex_charge"))
         {
 
         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"))
             {
 
             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.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"))
         }
 
                if(cvar("g_balance_nex_secondary_charge_pool"))