1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Fix song select leaderboard potentially showing wrong scores on quick beatmap changes

Closes #22002.
This commit is contained in:
Dean Herbert 2023-01-03 00:55:05 +08:00
parent 53cc71c2fe
commit 8f7ae0395a

View File

@ -154,10 +154,17 @@ namespace osu.Game.Screens.Select.Leaderboards
scoreRetrievalRequest = new GetScoresRequest(fetchBeatmapInfo, fetchRuleset, Scope, requestMods);
scoreRetrievalRequest.Success += response => SetScores(
scoreManager.OrderByTotalScore(response.Scores.Select(s => s.ToScoreInfo(rulesets, fetchBeatmapInfo))),
response.UserScore?.CreateScoreInfo(rulesets, fetchBeatmapInfo)
);
scoreRetrievalRequest.Success += response => Schedule(() =>
{
// Beatmap may have changed since fetch request. Can't rely on request cancellation due to Schedule inside SetScores.
if (!fetchBeatmapInfo.Equals(BeatmapInfo))
return;
SetScores(
scoreManager.OrderByTotalScore(response.Scores.Select(s => s.ToScoreInfo(rulesets, fetchBeatmapInfo))),
response.UserScore?.CreateScoreInfo(rulesets, fetchBeatmapInfo)
);
});
return scoreRetrievalRequest;
}