mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Fix song select leaderboard potentially showing wrong scores on quick beatmap changes
Closes #22002.
This commit is contained in:
parent
53cc71c2fe
commit
8f7ae0395a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user