diff --git a/osu.Game/Screens/Play/InGameScoreContainer.cs b/osu.Game/Screens/Play/InGameScoreContainer.cs index 36dbec7fce..3949307dca 100644 --- a/osu.Game/Screens/Play/InGameScoreContainer.cs +++ b/osu.Game/Screens/Play/InGameScoreContainer.cs @@ -65,7 +65,7 @@ namespace osu.Game.Screens.Play /// Returns the drawable score item of that player. public InGameScoreItem AddScore(ScoreInfo score, int? initialPosition = null) => score != null ? addScore(score.TotalScore, score.User, initialPosition) : null; - private int maxPosition => this.Where(i => i.ScorePosition.HasValue).Max(i => i.ScorePosition) ?? 0; + private int maxPosition => this.Max(i => this.Any(item => item.InitialPosition.HasValue) ? i.InitialPosition : i.ScorePosition) ?? 0; private InGameScoreItem addScore(double totalScore, User user = null, int? position = null) { @@ -87,13 +87,11 @@ namespace osu.Game.Screens.Play private void reorderPositions() { 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; + var orderedPositions = this.Select(i => this.Any(item => item.InitialPosition.HasValue) ? i.InitialPosition : i.ScorePosition).OrderByDescending(p => p.HasValue).ThenBy(p => p).ToList(); for (int i = 0; i < Count; i++) { - int newPosition = orderedPositions[i] ?? newDeclaredPosition; + int newPosition = orderedPositions[i] ?? maxPosition + 1; SetLayoutPosition(orderedByScore[i], newPosition); orderedByScore[i].ScorePosition = DeclareNewPosition ? newPosition : orderedPositions[i];