Compare commits
No commits in common. "a3f042e7f781ee8af3d53794ee6fdff31656dbb8" and "a11e708c4db851e3eb5822cb381a0d55ae0c0907" have entirely different histories.
a3f042e7f7
...
a11e708c4d
@ -488,6 +488,7 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
|
|||||||
Match_RegistrationIsOpen = False;
|
Match_RegistrationIsOpen = False;
|
||||||
|
|
||||||
// Eliminate last players
|
// Eliminate last players
|
||||||
|
Race::SortScores(Race::C_Sort_PrevRaceTime);
|
||||||
declare Integer ParticipantsNb = GetParticipantsNb();
|
declare Integer ParticipantsNb = GetParticipantsNb();
|
||||||
declare Integer AliveScoresNb = GetAliveScoresNb();
|
declare Integer AliveScoresNb = GetAliveScoresNb();
|
||||||
declare Integer LossOfLifeNb = GetLossOfLifeNb(Match_CurrentRoundNb, AliveScoresNb);
|
declare Integer LossOfLifeNb = GetLossOfLifeNb(Match_CurrentRoundNb, AliveScoresNb);
|
||||||
@ -841,6 +842,7 @@ Text GetScoreRemainingLivesText(CSmScore _Score) {
|
|||||||
Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
||||||
declare Text[] AccountIdsToDisplay = [];
|
declare Text[] AccountIdsToDisplay = [];
|
||||||
declare Text[][Text] CustomPoints = [];
|
declare Text[][Text] CustomPoints = [];
|
||||||
|
declare Integer[Text] CustomTimes = [];
|
||||||
|
|
||||||
declare Integer ParticipantsNb = GetParticipantsNb();
|
declare Integer ParticipantsNb = GetParticipantsNb();
|
||||||
declare Integer AliveScoresNb = GetAliveScoresNb();
|
declare Integer AliveScoresNb = GetAliveScoresNb();
|
||||||
@ -851,11 +853,11 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|||||||
if (!ScoreIsRegistered(Score)) continue;
|
if (!ScoreIsRegistered(Score)) continue;
|
||||||
AccountIdsToDisplay.add(Score.User.WebServicesUserId);
|
AccountIdsToDisplay.add(Score.User.WebServicesUserId);
|
||||||
if (!ScoreIsAlive(Score)) continue;
|
if (!ScoreIsAlive(Score)) continue;
|
||||||
|
|
||||||
if (_DisplayTimes) {
|
Scores::SetPlayerMatchPoints(Score, Scores.count + ParticipantsNb - Index);
|
||||||
Scores::SetPlayerMatchPoints(Score, ParticipantsNb + ParticipantsNb - Index);
|
if (_DisplayTimes && Score.PrevRaceTimes.count == 0) {
|
||||||
} else {
|
CustomTimes[Score.User.WebServicesUserId] = 0; //@ prev race is updated automatically at the moment (22/10/20) so we need to use this
|
||||||
Scores::SetPlayerMatchPoints(Score, ParticipantsNb + GetScoreRemainingLives(Score));
|
} else if (!_DisplayTimes) {
|
||||||
CustomPoints[Score.User.WebServicesUserId] = [GetScoreRemainingLivesText(Score)];
|
CustomPoints[Score.User.WebServicesUserId] = [GetScoreRemainingLivesText(Score)];
|
||||||
}
|
}
|
||||||
if (AliveScoresNb == 1 && ParticipantsNb > 1) {
|
if (AliveScoresNb == 1 && ParticipantsNb > 1) {
|
||||||
@ -867,9 +869,7 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|||||||
declare Text[Text] CustomRanks = [];
|
declare Text[Text] CustomRanks = [];
|
||||||
Race::SortScores(Race::C_Sort_TotalPoints);
|
Race::SortScores(Race::C_Sort_TotalPoints);
|
||||||
foreach (Score in Scores) {
|
foreach (Score in Scores) {
|
||||||
if (AliveScoresNb == 1 && ScoreIsAlive(Score)) {
|
if (ScoreIsAlive(Score)) {
|
||||||
CustomRanks[Score.User.WebServicesUserId] = "1";
|
|
||||||
} else if (ScoreIsAlive(Score)) {
|
|
||||||
CustomRanks[Score.User.WebServicesUserId] = "-";
|
CustomRanks[Score.User.WebServicesUserId] = "-";
|
||||||
} else if (ScoreIsRegistered(Score)) {
|
} else if (ScoreIsRegistered(Score)) {
|
||||||
CustomRanks[Score.User.WebServicesUserId] = ""^Rank;
|
CustomRanks[Score.User.WebServicesUserId] = ""^Rank;
|
||||||
@ -881,6 +881,7 @@ Void UpdateCustomRanking(Boolean _DisplayTimes) {
|
|||||||
UIModules_ScoresTable::SetCustomRanks(CustomRanks);
|
UIModules_ScoresTable::SetCustomRanks(CustomRanks);
|
||||||
UIModules_ScoresTable::DisplayOnly(AccountIdsToDisplay); // Display only registered players
|
UIModules_ScoresTable::DisplayOnly(AccountIdsToDisplay); // Display only registered players
|
||||||
UIModules_ScoresTable::SetCustomPoints(CustomPoints);
|
UIModules_ScoresTable::SetCustomPoints(CustomPoints);
|
||||||
|
UIModules_ScoresTable::SetCustomTimes(CustomTimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
|
||||||
@ -1331,17 +1332,15 @@ Void UpdateRanking() {
|
|||||||
} else {
|
} else {
|
||||||
declare Ident PlayerId = ScoreIdToPlayerId.get(Score.Id, NullId);
|
declare Ident PlayerId = ScoreIdToPlayerId.get(Score.Id, NullId);
|
||||||
if (PlayerId != NullId) {
|
if (PlayerId != NullId) {
|
||||||
declare CSmPlayer Player <=> Players.get(PlayerId, Null);
|
declare CSmPlayer Player <=> Players[PlayerId];
|
||||||
if (Player != Null) {
|
PlayerState.CPNb = Player.RaceWaypointTimes.count;
|
||||||
PlayerState.CPNb = Player.RaceWaypointTimes.count;
|
PlayerState.IsNotPlaying = (Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned);
|
||||||
PlayerState.IsNotPlaying = (Player.SpawnStatus == CSmPlayer::ESpawnStatus::NotSpawned);
|
PlayerState.Finished = (Score.PrevRaceTimes.count != 0);
|
||||||
PlayerState.Finished = (Score.PrevRaceTimes.count != 0);
|
|
||||||
|
if (PlayerState.CPNb > 0) {
|
||||||
if (PlayerState.CPNb > 0) {
|
PlayerState.LastCPTime = Player.RaceWaypointTimes[-1];
|
||||||
PlayerState.LastCPTime = Player.RaceWaypointTimes[-1];
|
|
||||||
}
|
|
||||||
if (GlobalLastCPTime < PlayerState.LastCPTime) GlobalLastCPTime = PlayerState.LastCPTime;
|
|
||||||
}
|
}
|
||||||
|
if (GlobalLastCPTime < PlayerState.LastCPTime) GlobalLastCPTime = PlayerState.LastCPTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1394,10 +1393,7 @@ Void UpdateRanking() {
|
|||||||
PlayerState.InDanger = (Rank >= LostOfLifeRank);
|
PlayerState.InDanger = (Rank >= LostOfLifeRank);
|
||||||
|
|
||||||
if (FirstPlayer == Null) {
|
if (FirstPlayer == Null) {
|
||||||
declare Ident FirstPlayerId = ScoreIdToPlayerId.get(PlayerState.ScoreId, NullId);
|
FirstPlayer <=> Players[ScoreIdToPlayerId.get(PlayerState.ScoreId, NullId)];
|
||||||
if (FirstPlayerId != NullId) {
|
|
||||||
FirstPlayer <=> Players[FirstPlayerId];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FirstPlayer != Null) {
|
if (FirstPlayer != Null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user