1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 03:22:59 +08:00

Fix reordering not declaring new position properly

Small bug fix
This commit is contained in:
iiSaLMaN 2019-07-31 16:09:40 +03:00
parent 77aa3a9fe5
commit 7675c679db

View File

@ -90,9 +90,11 @@ namespace osu.Game.Screens.Play
var orderedByScore = this.OrderByDescending(i => i.TotalScore).ToList();
var orderedPositions = this.OrderByDescending(i => i.ScorePosition.HasValue).ThenBy(i => i.ScorePosition).Select(i => i.ScorePosition).ToList();
var newDeclaredPosition = maxPosition + 1;
for (int i = 0; i < Count; i++)
{
int newPosition = orderedPositions[i] ?? maxPosition + 1;
int newPosition = orderedPositions[i] ?? newDeclaredPosition;
SetLayoutPosition(orderedByScore[i], newPosition);
orderedByScore[i].ScorePosition = DeclareNewPosition ? newPosition : orderedPositions[i];