3 #include "command/common.qh"
4 #include "mutators/all.qh"
5 #include "../common/playerstats.qh"
6 #include "../common/teams.qh"
9 entity teamscorekeepers[16];
10 float teamscores_entities_count;
11 var .float scores_primary;
12 var .float teamscores_primary;
13 float scores_flags_primary;
14 float teamscores_flags_primary;
16 vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, float strict) // returns: cmp value, best prio
18 if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
20 if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
22 if (t1.(field) == t2.(field))
25 previous.y = fieldflags & SFL_SORT_PRIO_MASK;
27 if(fieldflags & SFL_ZERO_IS_WORST)
34 else if (t2.(field) == 0)
41 if (fieldflags & SFL_LOWER_IS_BETTER)
42 previous.x = (t2.(field) - t1.(field));
44 previous.x = (t1.(field) - t2.(field));
53 bool TeamScore_SendEntity(entity this, entity to, float sendflags)
55 float i, p, longflags;
57 WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
58 int t = this.team - 1;
59 assert(t, eprint(this));
60 WriteByte(MSG_ENTITY, t);
63 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
64 if(self.(teamscores(i)) > 127 || self.(teamscores(i)) <= -128)
67 #if MAX_TEAMSCORE <= 8
68 WriteByte(MSG_ENTITY, sendflags);
69 WriteByte(MSG_ENTITY, longflags);
71 WriteShort(MSG_ENTITY, sendflags);
72 WriteShort(MSG_ENTITY, longflags);
74 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
78 WriteInt24_t(MSG_ENTITY, self.(teamscores(i)));
80 WriteChar(MSG_ENTITY, self.(teamscores(i)));
86 void TeamScore_Spawn(float t, string name)
88 entity ts = new_pure(csqc_score_team);
89 ts.netname = name; // not used yet, FIXME
91 Net_LinkEntity(ts, false, 0, TeamScore_SendEntity);
92 teamscorekeepers[t - 1] = ts;
93 ++teamscores_entities_count;
94 PlayerStats_GameReport_AddTeam(t);
97 float TeamScore_AddToTeam(float t, float scorefield, float score)
104 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
105 if(t <= 0 || t >= 16)
109 error("Adding score to invalid team!");
111 s = teamscorekeepers[t - 1];
116 error("Adding score to unknown team!");
119 if(teamscores_label(scorefield) != "")
120 s.SendFlags |= pow(2, scorefield);
121 return (s.(teamscores(scorefield)) += score);
124 float TeamScore_Add(entity player, float scorefield, float score)
126 return TeamScore_AddToTeam(player.team, scorefield, score);
129 float TeamScore_Compare(entity t1, entity t2, float strict)
131 if(!t1 || !t2) return (!t2) - !t1;
133 vector result = '0 0 0';
135 for(i = 0; i < MAX_TEAMSCORE; ++i)
139 result = ScoreField_Compare(t1, t2, f, teamscores_flags(i), result, strict);
142 if (result.x == 0 && strict)
143 result.x = t1.team - t2.team;
149 * the scoreinfo entity
152 void ScoreInfo_SetLabel_PlayerScore(PlayerScoreField i, string label, float scoreflags)
154 scores_label(i) = label;
155 scores_flags(i) = scoreflags;
156 if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
158 scores_primary = scores(i);
159 scores_flags_primary = scoreflags;
163 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
164 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
168 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
170 teamscores_label(i) = label;
171 teamscores_flags(i) = scoreflags;
172 if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
174 teamscores_primary = teamscores(i);
175 teamscores_flags_primary = scoreflags;
179 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
180 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
184 bool ScoreInfo_SendEntity(entity this, entity to, int sf)
187 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
188 WriteInt24_t(MSG_ENTITY, MapInfo_LoadedGametype);
189 FOREACH(Scores, true, {
190 WriteString(MSG_ENTITY, scores_label(it));
191 WriteByte(MSG_ENTITY, scores_flags(it));
193 for(i = 0; i < MAX_TEAMSCORE; ++i)
195 WriteString(MSG_ENTITY, teamscores_label(i));
196 WriteByte(MSG_ENTITY, teamscores_flags(i));
201 void ScoreInfo_Init(float teams)
203 if(scores_initialized)
205 scores_initialized.SendFlags |= 1; // force a resend
209 scores_initialized = new_pure(ent_client_scoreinfo);
210 Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity);
213 TeamScore_Spawn(NUM_TEAM_1, "Red");
215 TeamScore_Spawn(NUM_TEAM_2, "Blue");
217 TeamScore_Spawn(NUM_TEAM_3, "Yellow");
219 TeamScore_Spawn(NUM_TEAM_4, "Pink");
223 * per-player score entities
226 bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
228 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES);
229 WriteByte(MSG_ENTITY, etof(self.owner));
232 FOREACH(Scores, true, {
233 int p = 1 << (i % 16);
234 if (self.(scores(it)) > 127 || self.(scores(it)) <= -128)
238 WriteShort(MSG_ENTITY, sendflags);
239 WriteShort(MSG_ENTITY, longflags);
240 FOREACH(Scores, true, {
241 int p = 1 << (i % 16);
245 WriteInt24_t(MSG_ENTITY, self.(scores(it)));
247 WriteChar(MSG_ENTITY, self.(scores(it)));
254 float PlayerScore_Clear(entity player)
258 if(teamscores_entities_count)
261 if(MUTATOR_CALLHOOK(ForbidPlayerScore_Clear)) return 0;
263 sk = player.scorekeeper;
264 FOREACH(Scores, true, {
265 if(sk.(scores(it)) != 0)
266 if(scores_label(it) != "")
267 sk.SendFlags |= pow(2, i % 16);
274 void Score_ClearAll()
278 FOREACH_CLIENTSLOT(true, {
281 FOREACH(Scores, true, {
282 if(sk.(scores(it)) != 0)
283 if(scores_label(it) != "")
284 sk.SendFlags |= pow(2, i % 16);
288 for(t = 0; t < 16; ++t)
290 sk = teamscorekeepers[t];
293 for(int j = 0; j < MAX_TEAMSCORE; ++j)
295 if(sk.(teamscores(j)) != 0)
296 if(teamscores_label(j) != "")
297 sk.SendFlags |= pow(2, j);
298 sk.(teamscores(j)) = 0;
303 void PlayerScore_Attach(entity player)
305 if(player.scorekeeper)
306 error("player already has a scorekeeper");
307 entity sk = new_pure(scorekeeper);
309 Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity);
310 player.scorekeeper = sk;
313 void PlayerScore_Detach(entity player)
315 if(!player.scorekeeper)
316 error("player has no scorekeeper");
317 remove(player.scorekeeper);
318 player.scorekeeper = world;
321 float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
323 bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score);
327 if(!mutator_returnvalue)
330 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
331 entity s = player.scorekeeper;
336 LOG_WARNING("Adding score to unknown player!");
340 if(scores_label(scorefield) != "")
341 s.SendFlags |= pow(2, scorefield.m_id % 16);
343 PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
344 return (s.(scores(scorefield)) += score);
347 float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score)
350 r = PlayerScore_Add(player, pscorefield, score);
351 if(teamscores_entities_count) // only for teamplay
352 r = TeamScore_Add(player, tscorefield, score);
356 float PlayerScore_Compare(entity t1, entity t2, float strict)
358 if(!t1 || !t2) return (!t2) - !t1;
360 vector result = '0 0 0';
361 FOREACH(Scores, true, {
362 var .float f = scores(it);
363 result = ScoreField_Compare(t1, t2, f, scores_flags(it), result, strict);
366 if (result.x == 0 && strict)
367 result.x = etof(t1.owner) - etof(t2.owner);
372 void WinningConditionHelper()
378 entity winnerscorekeeper;
379 entity secondscorekeeper;
383 // gametype:P<pure>:S<slots>::plabel,plabel:tlabel,tlabel:teamid:tscore,tscore:teamid:tscore,tscore
384 // score labels always start with a symbol or with lower case
385 // so to match pure, match for :P0:
386 // to match full, match for :S0:
388 fullstatus = autocvar_g_full_getstatus_responses;
391 s = strcat(s, ":", autocvar_g_xonoticversion);
392 s = strcat(s, ":P", ftos(cvar_purechanges_count));
393 s = strcat(s, ":S", ftos(nJoinAllowed(self, world)));
394 s = strcat(s, ":F", ftos(serverflags));
395 s = strcat(s, ":M", modname);
396 s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2)));
398 if(teamscores_entities_count)
402 s = strcat(s, ":", GetTeamScoreString(0, 1));
403 for(t = 0; t < 16; ++t)
404 if(teamscorekeepers[t])
405 s = strcat(s, ":", ftos(t+1), ":", GetTeamScoreString(t+1, 1));
407 WinningConditionHelper_winnerteam = -1;
408 WinningConditionHelper_secondteam = -1;
409 winnerscorekeeper = world;
410 secondscorekeeper = world;
411 for(t = 0; t < 16; ++t)
413 sk = teamscorekeepers[t];
414 c = TeamScore_Compare(winnerscorekeeper, sk, 1);
417 WinningConditionHelper_secondteam = WinningConditionHelper_winnerteam;
418 WinningConditionHelper_winnerteam = t + 1;
419 secondscorekeeper = winnerscorekeeper;
420 winnerscorekeeper = sk;
424 c = TeamScore_Compare(secondscorekeeper, sk, 1);
427 WinningConditionHelper_secondteam = t + 1;
428 secondscorekeeper = sk;
433 WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
434 if(WinningConditionHelper_equality)
435 WinningConditionHelper_winnerteam = WinningConditionHelper_secondteam = -1;
437 WinningConditionHelper_topscore = winnerscorekeeper.teamscores_primary;
438 WinningConditionHelper_secondscore = secondscorekeeper.teamscores_primary;
439 WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER);
440 WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST);
442 WinningConditionHelper_winner = world; // not supported in teamplay
443 WinningConditionHelper_second = world; // not supported in teamplay
447 WinningConditionHelper_winner = world;
448 WinningConditionHelper_second = world;
449 winnerscorekeeper = world;
450 secondscorekeeper = world;
451 FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
453 c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
456 WinningConditionHelper_second = WinningConditionHelper_winner;
457 WinningConditionHelper_winner = it;
458 secondscorekeeper = winnerscorekeeper;
459 winnerscorekeeper = sk;
463 c = PlayerScore_Compare(secondscorekeeper, sk, 1);
466 WinningConditionHelper_second = it;
467 secondscorekeeper = sk;
472 WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
473 if(WinningConditionHelper_equality)
474 WinningConditionHelper_winner = WinningConditionHelper_second = world;
476 WinningConditionHelper_topscore = winnerscorekeeper.scores_primary;
477 WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;
478 WinningConditionHelper_lowerisbetter = (scores_flags_primary & SFL_LOWER_IS_BETTER);
479 WinningConditionHelper_zeroisworst = (scores_flags_primary & SFL_ZERO_IS_WORST);
481 WinningConditionHelper_winnerteam = -1; // no teamplay
482 WinningConditionHelper_secondteam = -1; // no teamplay
485 if(WinningConditionHelper_topscore == 0)
487 if(scores_flags_primary & SFL_ZERO_IS_WORST)
489 if(WinningConditionHelper_lowerisbetter)
490 WinningConditionHelper_topscore = 999999999;
492 WinningConditionHelper_topscore = -999999999;
494 WinningConditionHelper_equality = 0;
497 if(WinningConditionHelper_secondscore == 0)
499 if(scores_flags_primary & SFL_ZERO_IS_WORST)
501 if(WinningConditionHelper_lowerisbetter)
502 WinningConditionHelper_secondscore = 999999999;
504 WinningConditionHelper_secondscore = -999999999;
509 strunzone(worldstatus);
510 worldstatus = strzone(s);
512 FOREACH_CLIENT(true, LAMBDA(
516 s = GetPlayerScoreString(it, 1);
517 s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot");
518 ret_string = string_null;
519 if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
520 s = strcat(s, ":spectator");
521 if (ret_string) s = strcat(s, ret_string);
525 ret_string = string_null;
526 if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
527 s = GetPlayerScoreString(it, 2);
530 if (ret_string) s = strcat(s, ret_string);
534 strunzone(it.clientstatus);
535 it.clientstatus = strzone(s);
539 string GetScoreLogLabel(string label, float fl)
541 if(fl & SFL_LOWER_IS_BETTER)
542 label = strcat(label, "<");
543 if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
544 label = strcat(label, "!!");
545 else if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
546 label = strcat(label, "!");
550 string GetPlayerScoreString(entity pl, float shortString)
561 FOREACH(Scores, true, {
562 if ((scores_flags(it) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
564 f = scores_flags(it);
565 l = scores_label(it);
566 out = strcat(out, GetScoreLogLabel(l, f), ",");
570 FOREACH(Scores, true, {
571 if((scores_flags(it) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
573 f = scores_flags(it);
574 l = scores_label(it);
575 out = strcat(out, GetScoreLogLabel(l, f), ",");
579 FOREACH(Scores, true, {
580 if((scores_flags(it) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
581 if((scores_flags(it) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
583 f = scores_flags(it);
584 l = scores_label(it);
585 out = strcat(out, GetScoreLogLabel(l, f), ",");
588 out = substring(out, 0, strlen(out) - 1);
590 else if((sk = pl.scorekeeper))
592 FOREACH(Scores, true, {
593 if ((scores_flags(it) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
594 out = strcat(out, ftos(sk.(scores(it))), ",");
597 FOREACH(Scores, true, {
598 if ((scores_flags(it) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
599 out = strcat(out, ftos(sk.(scores(it))), ",");
602 FOREACH(Scores, true, {
603 if((scores_flags(it) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
604 if((scores_flags(it) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
605 out = strcat(out, ftos(sk.(scores(it))), ",");
607 out = substring(out, 0, strlen(out) - 1);
612 string GetTeamScoreString(float tm, float shortString)
623 for(i = 0; i < MAX_TEAMSCORE; ++i)
624 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
626 f = teamscores_flags(i);
627 l = teamscores_label(i);
628 out = strcat(out, GetScoreLogLabel(l, f), ",");
631 for(i = 0; i < MAX_TEAMSCORE; ++i)
632 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
634 f = teamscores_flags(i);
635 l = teamscores_label(i);
636 out = strcat(out, GetScoreLogLabel(l, f), ",");
639 for(i = 0; i < MAX_TEAMSCORE; ++i)
640 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
641 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
643 f = teamscores_flags(i);
644 l = teamscores_label(i);
645 out = strcat(out, GetScoreLogLabel(l, f), ",");
647 out = substring(out, 0, strlen(out) - 1);
649 else if((sk = teamscorekeepers[tm - 1]))
651 for(i = 0; i < MAX_TEAMSCORE; ++i)
652 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
653 out = strcat(out, ftos(sk.(teamscores(i))), ",");
655 for(i = 0; i < MAX_TEAMSCORE; ++i)
656 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
657 out = strcat(out, ftos(sk.(teamscores(i))), ",");
659 for(i = 0; i < MAX_TEAMSCORE; ++i)
660 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
661 if((teamscores_flags(i) & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
662 out = strcat(out, ftos(sk.(teamscores(i))), ",");
663 out = substring(out, 0, strlen(out) - 1);
668 float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict)
670 if(teams && teamscores_entities_count)
672 if(p1.team != p2.team)
676 t1 = teamscorekeepers[p1.team - 1];
677 t2 = teamscorekeepers[p2.team - 1];
678 r = TeamScore_Compare(t1, t2, ((teams >= 0) ? 1 : strict));
685 return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
688 entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators)
690 entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
695 FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
697 FOREACH_CLIENT(it.scorekeeper,
700 if(it.frags == FRAGS_SPECTATOR)
706 // Now plist points to the whole list.
708 pfirst = plast = world;
713 pprev = pbestprev = world;
715 for(p = plist; (pprev = p), (p = p.chain); )
717 if(PlayerTeamScore_Compare(p, pbest, teams, strict) > 0)
724 // remove pbest out of the chain
725 if(pbestprev == world)
728 pbestprev.chain = pbest.chain;
732 if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
747 float TeamScore_GetCompareValue(float t)
752 if(t <= 0 || t >= 16)
756 error("Reading score of invalid team!");
759 sk = teamscorekeepers[t - 1];
762 s = sk.teamscores_primary;
763 if(teamscores_flags_primary & SFL_ZERO_IS_WORST)
766 if(teamscores_flags_primary & SFL_LOWER_IS_BETTER)
771 const float NAMEWIDTH = 22;
772 const float SCORESWIDTH = 58;
773 // TODO put this somewhere in common?
774 string Score_NicePrint_ItemColor(float vflags)
776 if(vflags & SFL_SORT_PRIO_PRIMARY)
778 else if(vflags & SFL_SORT_PRIO_SECONDARY)
784 void Score_NicePrint_Team(entity to, float t, float w)
792 sk = teamscorekeepers[t - 1];
795 s = strcat(s, Team_ColoredFullName(t));
796 for(i = 0; i < MAX_TEAMSCORE; ++i)
797 if(teamscores_label(i) != "")
799 fl = teamscores_flags(i);
800 sc = sk.(teamscores(i));
801 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc));
807 s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), ""));
809 FOREACH(Scores, true, {
810 if(scores_label(it) != "")
812 fl = scores_flags(it);
813 s2 = scores_label(it);
814 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, substring(s2, 0, w)));
821 void Score_NicePrint_Player(entity to, entity p, float w)
831 s = strcat(s, p.netname);
834 i = strlennocol(s) - NAMEWIDTH;
836 s = substring(s, 0, strlen(s) - i);
839 s = strcat(s, strpad(i, ""));
844 FOREACH(Scores, true, {
845 if(scores_label(it) != "")
847 fl = scores_flags(it);
848 sc = sk.(scores(it));
849 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc)));
856 void Score_NicePrint_Spectators(entity to)
858 print_to(to, "Spectators:");
861 void Score_NicePrint_Spectator(entity to, entity p)
863 print_to(to, strcat(" ", p.netname));
866 .float score_dummyfield;
867 void Score_NicePrint(entity to)
873 FOREACH(Scores, true, {
874 if(scores_label(it) != "")
877 w = bound(6, floor(SCORESWIDTH / t - 1), 9);
879 p = PlayerScore_Sort(score_dummyfield, 1, 1, 0);
882 if(!teamscores_entities_count)
883 Score_NicePrint_Team(to, t, w);
886 if(teamscores_entities_count)
888 Score_NicePrint_Team(to, p.team, w);
889 Score_NicePrint_Player(to, p, w);
895 FOREACH_CLIENT(!IS_PLAYER(it), LAMBDA(
897 Score_NicePrint_Spectators(to);
898 Score_NicePrint_Spectator(to, it);
903 void PlayerScore_PlayerStats(entity p)
905 entity s = p.scorekeeper;
906 FOREACH(Scores, true, {
907 if(s.(scores(it)) != 0)
908 if(scores_label(it) != "")
909 PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label(it)), s.(scores(it)));
913 void PlayerScore_TeamStats()
917 for(t = 0; t < 16; ++t)
919 sk = teamscorekeepers[t];
922 for(i = 0; i < MAX_TEAMSCORE; ++i)
923 if(sk.(teamscores(i)) != 0)
924 if(teamscores_label(i) != "")
925 // the +1 is important here!
926 PS_GR_T_ADDVAL(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label(i)), sk.(teamscores(i)));