diff --git a/osu.Game/Online/API/Requests/Responses/APIUserMatchmakingStatistics.cs b/osu.Game/Online/API/Requests/Responses/APIUserMatchmakingStatistics.cs index 97f9a14ef6..e48fa72be9 100644 --- a/osu.Game/Online/API/Requests/Responses/APIUserMatchmakingStatistics.cs +++ b/osu.Game/Online/API/Requests/Responses/APIUserMatchmakingStatistics.cs @@ -17,7 +17,7 @@ namespace osu.Game.Online.API.Requests.Responses public int Rating { get; set; } [JsonProperty("rank")] - public int Rank { get; set; } + public int? Rank { get; set; } [JsonProperty("plays")] public int Plays { get; set; } diff --git a/osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs b/osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs index e6bb42fedc..34221540ba 100644 --- a/osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs +++ b/osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs @@ -114,12 +114,20 @@ namespace osu.Game.Overlays.Profile.Header.Components return; } - APIUserMatchmakingStatistics[] mostRelevantStats = stats.OrderByDescending(s => s.Pool.Active).ThenByDescending(s => s.Pool.Id).ToArray(); - APIUserMatchmakingStatistics mostRelevantStat = mostRelevantStats.First(); + int? highestRank = null; - rankText.Text = $"#{mostRelevantStat.Rank:N0}"; + foreach (var stat in stats) + { + if (stat.Pool.Active && stat.Rank != null) + { + if (highestRank == null || stat.Rank < highestRank) + highestRank = stat.Rank; + } + } - TooltipContent = new MatchmakingStatsTooltipData(colourProvider, mostRelevantStats); + rankText.Text = highestRank == null ? "-" : $"#{highestRank:N0}"; + + TooltipContent = new MatchmakingStatsTooltipData(colourProvider, stats.OrderByDescending(s => s.PoolId).ToArray()); Show(); }