From 17fb0cf62f914e4f77a90470d411eb870a410c9c Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 17 Nov 2015 20:59:47 +1000 Subject: [PATCH] Do another 6 --- qcsrc/client/announcer.qc | 4 ++-- qcsrc/client/scoreboard.qc | 10 +++++----- qcsrc/common/stats.qh | 14 +++++++------- qcsrc/common/triggers/trigger/secret.qh | 4 ++-- qcsrc/server/defs.qh | 4 ++-- qcsrc/server/g_world.qc | 12 ------------ 6 files changed, 18 insertions(+), 30 deletions(-) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index fa8f2b005..ab1cd1366 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -19,7 +19,7 @@ void Announcer_Countdown() { SELFPARAM(); float starttime = STAT(GAMESTARTTIME); - float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + float roundstarttime = STAT(ROUNDSTARTTIME); if(roundstarttime == -1) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP); @@ -70,7 +70,7 @@ void Announcer_Countdown() void Announcer_Gamestart() { float startTime = STAT(GAMESTARTTIME); - float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + float roundstarttime = STAT(ROUNDSTARTTIME); if(roundstarttime > startTime) startTime = roundstarttime; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index e15ca8a07..b00690ff8 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -1133,12 +1133,12 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) { string val; // get monster stats - stat_monsters_killed = getstatf(STAT_MONSTERS_KILLED); - stat_monsters_total = getstatf(STAT_MONSTERS_TOTAL); + stat_monsters_killed = STAT(MONSTERS_KILLED); + stat_monsters_total = STAT(MONSTERS_TOTAL); // get secrets stats - stat_secrets_found = getstatf(STAT_SECRETS_FOUND); - stat_secrets_total = getstatf(STAT_SECRETS_TOTAL); + stat_secrets_found = STAT(SECRETS_FOUND); + stat_secrets_total = STAT(SECRETS_TOTAL); // get number of rows if(stat_secrets_total) @@ -1458,7 +1458,7 @@ void HUD_DrawScoreboard() drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL); // print information about respawn status - float respawn_time = getstatf(STAT_RESPAWN_TIME); + float respawn_time = STAT(RESPAWN_TIME); if(!intermission) if(respawn_time) { diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 7eeefc6ab..86799ce03 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -89,7 +89,7 @@ enum { STAT_LAST_VECTOR }; -const int REGISTERED_STATS = 33; +const int REGISTERED_STATS = 39; REGISTER_STAT(KH_KEYS, int) /** weapon requested to switch to; next WANTED weapon (for HUD) */ @@ -130,16 +130,16 @@ REGISTER_STAT(VEHICLESTAT_AMMO2, int) REGISTER_STAT(VEHICLESTAT_RELOAD2, int) REGISTER_STAT(VEHICLESTAT_W2MODE, int) REGISTER_STAT(NADE_TIMER, float) +REGISTER_STAT(SECRETS_TOTAL, float) +REGISTER_STAT(SECRETS_FOUND, float) +REGISTER_STAT(RESPAWN_TIME, float) +REGISTER_STAT(ROUNDSTARTTIME, float) +REGISTER_STAT(MONSTERS_TOTAL, int) +REGISTER_STAT(MONSTERS_KILLED, int) enum { STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS, - STAT_SECRETS_TOTAL, - STAT_SECRETS_FOUND, - STAT_RESPAWN_TIME, - STAT_ROUNDSTARTTIME, - STAT_MONSTERS_TOTAL, - STAT_MONSTERS_KILLED, STAT_BUFFS, STAT_NADE_BONUS, STAT_NADE_BONUS_TYPE, diff --git a/qcsrc/common/triggers/trigger/secret.qh b/qcsrc/common/triggers/trigger/secret.qh index c09da6b96..dace6045f 100644 --- a/qcsrc/common/triggers/trigger/secret.qh +++ b/qcsrc/common/triggers/trigger/secret.qh @@ -13,8 +13,8 @@ float secrets_total; float secrets_found; -.float stat_secrets_total; -.float stat_secrets_found; +.float stat_secrets_total = _STAT(SECRETS_TOTAL); +.float stat_secrets_found = _STAT(SECRETS_FOUND); /** * update secrets status. diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 0a515212e..28d402160 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -398,7 +398,7 @@ float cvar_purechanges_count; float game_starttime; //point in time when the countdown to game start is over float round_starttime; //point in time when the countdown to round start is over .float stat_game_starttime = _STAT(GAMESTARTTIME); -.float stat_round_starttime; +.float stat_round_starttime = _STAT(ROUNDSTARTTIME); void W_Porto_Remove (entity p); @@ -523,7 +523,7 @@ const float ACTIVE_TOGGLE = 3; .entity muzzle_flash; .float misc_bulletcounter; // replaces uzi & hlac bullet counter. -.float stat_respawn_time; // shows respawn time, and is negative when awaiting respawn +.float stat_respawn_time = _STAT(RESPAWN_TIME); // shows respawn time, and is negative when awaiting respawn void PlayerUseKey(); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 9b752144a..ea6cc6bff 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -757,7 +757,6 @@ spawnfunc(worldspawn) WepSet_AddStat(); WepSet_AddStat_InMap(); - addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime); Nagger_Init(); addstat(STAT_PLASMA, AS_INT, ammo_plasma); @@ -790,17 +789,6 @@ spawnfunc(worldspawn) addstat(STAT_MOVEVARS_AIRACCELERATE, AS_FLOAT, stat_sv_airaccelerate); addstat(STAT_MOVEVARS_AIRSTOPACCELERATE, AS_FLOAT, stat_sv_airstopaccelerate); - // secrets - addstat(STAT_SECRETS_TOTAL, AS_FLOAT, stat_secrets_total); - addstat(STAT_SECRETS_FOUND, AS_FLOAT, stat_secrets_found); - - // monsters - addstat(STAT_MONSTERS_TOTAL, AS_FLOAT, stat_monsters_total); - addstat(STAT_MONSTERS_KILLED, AS_FLOAT, stat_monsters_killed); - - // misc - addstat(STAT_RESPAWN_TIME, AS_FLOAT, stat_respawn_time); - next_pingtime = time + 5; detect_maptype(); -- 2.39.2