]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 5b765396c4641aa847b5aacd2c20f3dc395d726f..6daf741fbbff47f03ecce8945d30649df61a4b0f 100644 (file)
@@ -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)
                {
index 6e3210859dc65d2c80ccf4b31f4662551237d917..7d5b76920085394043f388d9ddc5306ae93a6a44 100644 (file)
@@ -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"))