From: TimePath Date: Sat, 7 Nov 2015 05:14:25 +0000 (+1100) Subject: Stats: register NB_METERSTART X-Git-Tag: xonotic-v0.8.2~1609^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f46dcbfcdfb1f37d008b540204d4accc51ceee0;p=xonotic%2Fxonotic-data.pk3dir.git Stats: register NB_METERSTART --- 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,