From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Mon, 11 Apr 2011 11:07:41 +0000 (+0300)
Subject: Create two stats for the hagar loading feature. Will be used for the crosshair inner... 
X-Git-Tag: xonotic-v0.5.0~263^2~10^2~85
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b730aeae9a2f20c3364bf10a1afb760e10f47753;p=xonotic%2Fxonotic-data.pk3dir.git

Create two stats for the hagar loading feature. Will be used for the crosshair inner ring, to show how many rockets have been loaded.
---

diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh
index 419ab73e8f..22fa7c2629 100644
--- a/qcsrc/common/constants.qh
+++ b/qcsrc/common/constants.qh
@@ -317,6 +317,8 @@ const float STAT_NEX_CHARGEPOOL = 53;
 const float STAT_HIT_TIME = 54;
 const float STAT_TYPEHIT_TIME = 55;
 const float STAT_LAYED_MINES = 56;
+const float STAT_HAGAR_LOAD = 57;
+const float STAT_HAGAR_MAXLOAD = 58;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc
index a1047ea9d0..48c2d43e77 100644
--- a/qcsrc/server/cl_client.qc
+++ b/qcsrc/server/cl_client.qc
@@ -2369,6 +2369,8 @@ void SpectateCopy(entity spectatee) {
 	self.weapon = spectatee.weapon;
 	self.nex_charge = spectatee.nex_charge;
 	self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo;
+	self.hagar_load = spectatee.hagar_load;
+	self.hagar_maxload = spectatee.hagar_maxload;
 	self.minelayer_mines = spectatee.minelayer_mines;
 	self.punchangle = spectatee.punchangle;
 	self.view_ofs = spectatee.view_ofs;
diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh
index d7179fafeb..27b908a586 100644
--- a/qcsrc/server/defs.qh
+++ b/qcsrc/server/defs.qh
@@ -658,6 +658,9 @@ string deathmessage;
 .float nex_charge_rottime;
 .float nex_chargepool_ammo;
 
+.float hagar_load;
+.float hagar_maxload;
+
 float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
 
 float serverflags;
diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc
index c45ad96e29..c83ddd8211 100644
--- a/qcsrc/server/g_world.qc
+++ b/qcsrc/server/g_world.qc
@@ -833,6 +833,9 @@ void spawnfunc_worldspawn (void)
 	addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
 	addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
 
+	addstat(STAT_HAGAR_LOAD, AS_FLOAT, hagar_load);
+	addstat(STAT_HAGAR_MAXLOAD, AS_FLOAT, hagar_maxload);
+
 	if(g_ca || g_freezetag)
 	{
 		addstat(STAT_REDALIVE, AS_INT, redalive_stat);