From be9cce5a55a4e8135e1869c8f33b8622edd6ad36 Mon Sep 17 00:00:00 2001
From: FruitieX <fruitiex@gmail.com>
Date: Sat, 6 Nov 2010 16:25:15 +0200
Subject: [PATCH] remove unused variable, set the movingavg nexcharge to =
 nexcharge if it's 0 (should only happen right after a game started)

---
 qcsrc/client/Defs.qc | 2 ++
 qcsrc/client/View.qc | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc
index 0d822e164..959d593a3 100644
--- a/qcsrc/client/Defs.qc
+++ b/qcsrc/client/Defs.qc
@@ -267,3 +267,5 @@ float bgmtime;
 
 string weaponorder_byimpulse;
 string weaponorder_bypriority;
+
+float nex_charge_movingavg;
diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc
index 211bb9e98..235b3aedf 100644
--- a/qcsrc/client/View.qc
+++ b/qcsrc/client/View.qc
@@ -350,7 +350,6 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
-float nex_charge_movingavg, nex_charge_current_avg;
 
 void CSQC_UpdateView(float w, float h)
 {
@@ -859,6 +858,9 @@ void CSQC_UpdateView(float w, float h)
 			float nex_charge;
 			nex_charge = getstatf(STAT_NEX_CHARGE);
 
+			if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
+				nex_charge_movingavg = nex_charge;
+
 			// ring around crosshair representing bullets left in camping rifle clip
 			if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
 			{
-- 
2.39.5