]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add a scores_accumulated field (not used yet) that does not reset under any circumstances
authorRudolf Polzer <divverent@alientrap.org>
Fri, 14 Jan 2011 21:42:45 +0000 (22:42 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 14 Jan 2011 21:42:45 +0000 (22:42 +0100)
qcsrc/server/scores.qc
qcsrc/server/scores.qh

index 2c5e2b14490498ef2f8190f3530c92e77e450796..b0f9293db27344666d605ba4cb5f3b2b55977778 100644 (file)
@@ -245,6 +245,7 @@ void PlayerScore_Clear(entity player)
 
        if(teamscores_entities_count)
                return;
+
        if(g_lms) return;
        if(g_arena || g_ca) return;
        if(g_race && !g_race_qualifying) return;
@@ -256,6 +257,7 @@ void PlayerScore_Clear(entity player)
                        if(scores_label[i] != "")
                                sk.SendFlags |= pow(2, i);
                sk.(scores[i]) = 0;
+               // do NOT clear scores_accumulated!
        }
 }
 
@@ -274,6 +276,7 @@ void Score_ClearAll()
                                if(scores_label[i] != "")
                                        sk.SendFlags |= pow(2, i);
                        sk.(scores[i]) = 0;
+                       // do NOT clear scores_accumulated!
                }
        }
        for(t = 0; t < 16; ++t)
@@ -330,6 +333,7 @@ float PlayerScore_Add(entity player, float scorefield, float score)
        if(score)
                if(scores_label[scorefield] != "")
                        s.SendFlags |= pow(2, scorefield);
+       s.(scores_accumulated[scorefield]) += score;
        return (s.(scores[scorefield]) += score);
 }
 
index 3ac0b03b5577dd49cf5dbb5eea7e1ad7e2fd02e6..f94b683323dfb8b57d974c7d2b2dd683ace5d90b 100644 (file)
@@ -2,6 +2,8 @@ entity scores_initialized; // non-world when scores labels/rules have been set
 .float scores[MAX_SCORE];
 .float teamscores[MAX_TEAMSCORE];
 
+.float scores_accumulated[MAX_SCORE]; // for player stats only
+
 /**
  * Attaches a PlayerScore entity to a player. Use that in ClientConnect.
  * Remember to detach it in ClientDisconnect!