mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
Fix display update condition
This commit is contained in:
parent
5d68701321
commit
fd80ffd52b
@ -85,15 +85,15 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
StarDifficulty minDifficulty;
|
StarDifficulty minDifficulty;
|
||||||
StarDifficulty maxDifficulty;
|
StarDifficulty maxDifficulty;
|
||||||
|
|
||||||
if (DifficultyRange.Value != null)
|
if (DifficultyRange.Value != null && Playlist.Count == 0)
|
||||||
{
|
{
|
||||||
|
// When Playlist is empty (in lounge) we take retrieved range
|
||||||
minDifficulty = new StarDifficulty(DifficultyRange.Value.Min, 0);
|
minDifficulty = new StarDifficulty(DifficultyRange.Value.Min, 0);
|
||||||
maxDifficulty = new StarDifficulty(DifficultyRange.Value.Max, 0);
|
maxDifficulty = new StarDifficulty(DifficultyRange.Value.Max, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// In multiplayer rooms, the beatmaps of playlist items will not be populated to a point this can be correct.
|
// When Playlist is not empty (in room) we compute actual range
|
||||||
// Either populating them via BeatmapLookupCache or polling the API for the room's DifficultyRange will be required.
|
|
||||||
var orderedDifficulties = Playlist.Select(p => p.Beatmap).OrderBy(b => b.StarRating).ToArray();
|
var orderedDifficulties = Playlist.Select(p => p.Beatmap).OrderBy(b => b.StarRating).ToArray();
|
||||||
|
|
||||||
minDifficulty = new StarDifficulty(orderedDifficulties.Length > 0 ? orderedDifficulties[0].StarRating : 0, 0);
|
minDifficulty = new StarDifficulty(orderedDifficulties.Length > 0 ? orderedDifficulties[0].StarRating : 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user