]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Do another 6
authorMario <mario@smbclan.net>
Tue, 17 Nov 2015 10:59:47 +0000 (20:59 +1000)
committerMario <mario@smbclan.net>
Tue, 17 Nov 2015 10:59:47 +0000 (20:59 +1000)
qcsrc/client/announcer.qc
qcsrc/client/scoreboard.qc
qcsrc/common/stats.qh
qcsrc/common/triggers/trigger/secret.qh
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index fa8f2b0055b51395ed0248ae4129cc1e741d55fa..ab1cd1366240eafcd1cfb3d058bec1d70a0f5122 100644 (file)
@@ -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;
 
index e15ca8a07f2dd99b18fe1074f75c212c148967a2..b00690ff86a8410bf44c6e14860d0b75b396a69c 100644 (file)
@@ -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)
        {
index 7eeefc6ab71d5327bc8d11d5f2938ac29d73231e..86799ce03e3632bd3aff2bd701131b4169a1ed09 100644 (file)
@@ -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,
index c09da6b96563f883e8b5f7d0124b7ce6f48e953b..dace6045fb0c6a5dd40234adbabafd870cc32b52 100644 (file)
@@ -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.
index 0a515212ede4b6c6ef59316316a14fa1fa48ec6f..28d40216023eb082feac8d2650858f1543575f4c 100644 (file)
@@ -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();
 
index 9b752144a05b6814cfa7a13529d7ba26cd812f6e..ea6cc6bff0bf8c9218fb30db6e14a52021a2a013 100644 (file)
@@ -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();