]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Merge branch 'master' into terencehill/centerprint_stuff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index b2b0a138f1d964782c45731c157e7bda15e9a695..8d5fa100c92eec6bdc2f34a793ed917ccd7e5a92 100644 (file)
@@ -88,6 +88,7 @@ void TeamScore_Spawn(float t, string name)
        Net_LinkEntity(ts, FALSE, 0, TeamScore_SendEntity);
        teamscorekeepers[t - 1] = ts;
        ++teamscores_entities_count;
+       PlayerStats_AddTeam(t);
 }
 
 float TeamScore_AddToTeam(float t, float scorefield, float score)
@@ -374,7 +375,6 @@ void WinningConditionHelper()
        entity winnerscorekeeper;
        entity secondscorekeeper;
        entity sk;
-       float slots;
 
        // format:
        // gametype:P<pure>:S<slots>::plabel,plabel:tlabel,tlabel:teamid:tscore,tscore:teamid:tscore,tscore
@@ -891,3 +891,19 @@ void PlayerScore_PlayerStats(entity p)
                        if(scores_label[i] != "")
                                PlayerStats_Event(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
 }
+
+void PlayerScore_TeamStats(void)
+{
+       entity sk;
+       float t, i;
+       for(t = 0; t < 16; ++t)
+       {
+               sk = teamscorekeepers[t];
+               if(!sk)
+                       continue;
+               for(i = 0; i < MAX_TEAMSCORE; ++i)
+                       if(sk.(teamscores[i]) != 0)
+                               if(teamscores_label[i] != "")
+                                       PlayerStats_TeamScore(t, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
+       }
+}