]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Stats: register NB_METERSTART
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 05:14:25 +0000 (16:14 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 05:14:25 +0000 (16:14 +1100)
qcsrc/client/hud/panel/modicons.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/stats.qh

index a8cb7c2660042a16077b2069eed0b89f64436e79..11dd96fb43c424ac3cd7d5338f682d2919b837f2 100644 (file)
@@ -452,7 +452,7 @@ void HUD_Mod_NexBall(vector pos, vector mySize)
        int stat_items;
 
        stat_items = getstati(STAT_ITEMS, 0, 24);
-       nb_pb_starttime = getstatf(STAT_NB_METERSTART);
+       nb_pb_starttime = STAT(NB_METERSTART);
 
        if (stat_items & IT_KEY1)
                mod_active = 1;
index b4becb3979d7b20981ddc01c28ed5b0defa6be66..8ffdb08f9e6533a177c1c30d3735291598307829 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-.float metertime;
+.float metertime = _STAT(NB_METERSTART);
 
 int autocvar_g_nexball_goalleadlimit;
 #define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
@@ -1072,7 +1072,6 @@ REGISTER_MUTATOR(nb, g_nexball)
                if(g_nexball_meter_period <= 0)
                        g_nexball_meter_period = 2; // avoid division by zero etc. due to silly users
                g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
-               addstat(STAT_NB_METERSTART, AS_FLOAT, metertime);
 
                // General settings
                /*
index 0096000e4a9d882d05a38858c718487ce9b10127..3edaa36f35d42c406806ffb3ed2f6c6528a6583d 100644 (file)
@@ -89,7 +89,7 @@ enum {
     STAT_LAST_VECTOR
 };
 
-const int REGISTERED_STATS = 9;
+const int REGISTERED_STATS = 10;
 
 REGISTER_STAT(KH_KEYS, int)
 /** weapon requested to switch to; next WANTED weapon (for HUD) */
@@ -103,11 +103,11 @@ REGISTER_STAT(PRESSED_KEYS, int)
 /** this stat could later contain some other bits of info, like, more server-side particle config */
 REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool)
 REGISTER_STAT(FUEL, int)
+REGISTER_STAT(NB_METERSTART, float)
 
 enum {
     STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
 
-    STAT_NB_METERSTART,
     /** compressShotOrigin */ STAT_SHOTORG,
     STAT_LEADLIMIT,
     STAT_WEAPON_CLIPLOAD,