mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 18:44:15 +08:00
Do not attempt to add displayed score to list of sorted scores more than once
This is a very dodgy fix, but it fixes an edge case that has so far - to my knowledge - not been reported by users in the wild, only by me trying to break things, so my hope is that we can do this and move on for now.
This commit is contained in:
@@ -74,6 +74,12 @@ namespace osu.Game.Screens.Ranking
|
||||
// this simplifies handling later.
|
||||
if (clonedScore.Equals(Score) || clonedScore.MatchesOnlineID(Score))
|
||||
{
|
||||
// this is a precautionary guard that prevents `Score` from appearing multiple times in the list.
|
||||
// that can occur in rare cases wherein two local scores have the same online ID but different replay contents
|
||||
// (this is possible e.g. in cases of client-side vs server-side recorded replays, see https://github.com/ppy/osu-server-spectator/issues/193)
|
||||
if (sortedScores.Contains(Score))
|
||||
continue;
|
||||
|
||||
Score.Position = clonedScore.Position;
|
||||
sortedScores.Add(Score);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user