| 507 | } |
| 508 | |
| 509 | void winners() |
| 510 | { |
| 511 | string winners = ""; |
| 512 | vector<playerent *> scores; |
| 513 | if(!watchingdemo) scores.add(player1); |
| 514 | loopv(players) if(players[i]) { scores.add(players[i]); } |
| 515 | scores.sort(scorecmp); |
| 516 | discscores.sort(discscorecmp); |
| 517 | |
| 518 | if(m_teammode) |
| 519 | { |
| 520 | teamscore teamscores[2] = { teamscore(TEAM_CLA), teamscore(TEAM_RVSF) }; |
| 521 | |
| 522 | loopv(scores) if(scores[i]->team != TEAM_SPECT) teamscores[team_base(scores[i]->team)].addplayer(scores[i]); |
| 523 | loopv(discscores) if(discscores[i].team != TEAM_SPECT) |
| 524 | teamscores[team_base(discscores[i].team)].addscore(discscores[i]); |
| 525 | |
| 526 | int sort = teamscorecmp(&teamscores[TEAM_CLA], &teamscores[TEAM_RVSF]); |
| 527 | if(!sort) copystring(winners, "0 1"); |
| 528 | else itoa(winners, sort < 0 ? 0 : 1); |
| 529 | } |
| 530 | else |
| 531 | { |
| 532 | loopv(scores) |
| 533 | { |
| 534 | if(!i || !scorecmp(&scores[i], &scores[i-1])) concatformatstring(winners, "%s%d", i ? " " : "", scores[i]->clientnum); |
| 535 | else break; |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | result(winners); |
| 540 | } |
| 541 | |
| 542 | COMMAND(winners, ""); |
nothing calls this directly
no test coverage detected