return val;
}
-void PlayerStats_TeamScore(float t, string event_id, float value) // TODO: doesn't this remain unused?
+void PlayerStats_TeamScore(float t, string event_id, float value)
{
string key;
float val;
{
string p, pn;
string e, en;
- string nn, tt;
+ string nn, tt, ts;
string s;
switch(status)
{
tt = db_get(playerstats_db, sprintf("%s:_team", p));
url_fputs(fh, sprintf("t %s\n", tt));
+ ts = db_get(playerstats_db, sprintf("team#%d:%s-score", PLAYERSTATS_SCOREBOARD, stof(tt)));
+ if(ts != "")
+ url_fputs(fh, sprintf("e %s %s\n", strcat(PLAYERSTATS_SCOREBOARD, "teamscore"), ts));
}
for(e = events_last; (en = db_get(playerstats_db, sprintf("*:%s", e))) != ""; e = en)
{
entity p;
PlayerScore_Sort(score_dummyfield, 0, 0, 0);
PlayerScore_Sort(scoreboard_pos, 1, 1, 1);
+ if(teamplay)
+ PlayerScore_TeamStats();
FOR_EACH_CLIENT(p)
{
// add personal score rank
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]));
+ // the +1 is important here!
+ PlayerStats_TeamScore(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
}
}