]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Stats: register PRESSED_KEYS
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 04:34:59 +0000 (15:34 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 04:34:59 +0000 (15:34 +1100)
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/common/stats.qh
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index 94cc3287799e2833aa76598a2a1c8b78cdc18ffc..7d6955009764f5389424ed669955b0b6a1da4b99 100644 (file)
@@ -43,8 +43,7 @@ void HUD_PressedKeys()
 
        vector keysize;
        keysize = eX * mySize.x * (1/3.0) + eY * mySize.y * (1/(3.0 - !autocvar_hud_panel_pressedkeys_attack));
-       float pressedkeys;
-       pressedkeys = getstatf(STAT_PRESSED_KEYS);
+       int pressedkeys = STAT(PRESSED_KEYS);
 
        if(autocvar_hud_panel_pressedkeys_attack)
        {
index cbf54fef2918cc9f694c08913afe1c7251303926..31a7ab61885e191355418514070bd06d36158278 100644 (file)
@@ -89,7 +89,7 @@ enum {
     STAT_LAST_VECTOR
 };
 
-const int REGISTERED_STATS = 6;
+const int REGISTERED_STATS = 7;
 
 REGISTER_STAT(KH_KEYS, int)
 /** weapon requested to switch to; next WANTED weapon (for HUD) */
@@ -99,11 +99,11 @@ REGISTER_STAT(STRENGTH_FINISHED, float)
 REGISTER_STAT(INVINCIBLE_FINISHED, float)
 /** arc heat in [0,1] */
 REGISTER_STAT(ARC_HEAT, float)
+REGISTER_STAT(PRESSED_KEYS, int)
 
 enum {
     STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
 
-    STAT_PRESSED_KEYS,
     /** this stat could later contain some other bits of info, like, more server-side particle config */ STAT_ALLOW_OLDVORTEXBEAM,
     STAT_FUEL,
     STAT_NB_METERSTART,
index f4053cb33741432574c716c2aea8a5d90a1d067e..afdca0b06cbc685a9a4f14d180599514c9b6982f 100644 (file)
@@ -387,7 +387,7 @@ bool independent_players;
 
 string clientstuff;
 .float phase;
-.int pressedkeys;
+.int pressedkeys = _STAT(PRESSED_KEYS);
 
 .string fog;
 
index 6f3b56d779fd5c4d952450b8f8e88bc37089d50f..b60eb9c8217a171b51d49553f6229ba1a5e97ea3 100644 (file)
@@ -763,7 +763,6 @@ spawnfunc(worldspawn)
        Nagger_Init();
 
        addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
-       addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
        addstat(STAT_FUEL, AS_INT, ammo_fuel);
        addstat(STAT_PLASMA, AS_INT, ammo_plasma);
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);