From 0f46dcbfcdfb1f37d008b540204d4accc51ceee0 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 7 Nov 2015 16:14:25 +1100 Subject: [PATCH] Stats: register NB_METERSTART --- qcsrc/client/hud/panel/modicons.qc | 2 +- qcsrc/common/gamemodes/gamemode/nexball/nexball.qc | 3 +-- qcsrc/common/stats.qh | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index a8cb7c266..11dd96fb4 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -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; diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index b4becb397..8ffdb08f9 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -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 /* diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 0096000e4..3edaa36f3 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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, -- 2.39.2