From 719db1ba38268f5564b5a216ec535dc4ace7db2a Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 7 Nov 2015 15:34:59 +1100 Subject: [PATCH] Stats: register PRESSED_KEYS --- qcsrc/client/hud/panel/pressedkeys.qc | 3 +-- qcsrc/common/stats.qh | 4 ++-- qcsrc/server/defs.qh | 2 +- qcsrc/server/g_world.qc | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/hud/panel/pressedkeys.qc b/qcsrc/client/hud/panel/pressedkeys.qc index 94cc32877..7d6955009 100644 --- a/qcsrc/client/hud/panel/pressedkeys.qc +++ b/qcsrc/client/hud/panel/pressedkeys.qc @@ -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) { diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index cbf54fef2..31a7ab618 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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, diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f4053cb33..afdca0b06 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -387,7 +387,7 @@ bool independent_players; string clientstuff; .float phase; -.int pressedkeys; +.int pressedkeys = _STAT(PRESSED_KEYS); .string fog; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6f3b56d77..b60eb9c82 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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); -- 2.39.2