fix winner when player go as spectator

This commit is contained in:
Beu 2022-03-08 21:52:19 +01:00
parent 4a479a6d72
commit af01e18437

View File

@ -538,11 +538,14 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
if (WinnerScore == Null) { if (WinnerScore == Null) {
foreach (Score in Scores) { foreach (Score in Scores) {
if (Score.BestRaceTimes.count <= 0 && Score.User != Null && AccountIdsOfPlayers.exists(Score.User.WebServicesUserId)) { if (Score.BestRaceTimes.count <= 0 && Score.User != Null && AccountIdsOfPlayers.exists(Score.User.WebServicesUserId)) {
declare CSmPlayer Player = GetPlayer(Score.User.Login);
if (Player != Null && !Player.RequestsSpectate) {
WinnerScore <=> Score; WinnerScore <=> Score;
break; break;
} }
} }
} }
}
Scores::SetPlayerWinner(WinnerScore); Scores::SetPlayerWinner(WinnerScore);
declare Text Message = _("|Match|Draw"); declare Text Message = _("|Match|Draw");