mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Use better logic
We need to still perform selection if selectedBeatmap itself is null
This commit is contained in:
parent
33480b85c8
commit
e4a8402d3c
@ -194,11 +194,14 @@ namespace osu.Game.Screens.Select
|
||||
if (!Items.Any())
|
||||
return;
|
||||
|
||||
var d = selectedBeatmap?.Drawables.FirstOrDefault();
|
||||
if (d == null)
|
||||
DrawableCarouselItem drawable = null;
|
||||
|
||||
if (selectedBeatmap != null && (drawable = selectedBeatmap.Drawables.FirstOrDefault()) == null)
|
||||
// if the selected beatmap isn't present yet, we can't correctly change selection.
|
||||
// we can fix this by changing this method to not reference drawables / Items in the first place.
|
||||
return;
|
||||
|
||||
int originalIndex = Items.IndexOf(d);
|
||||
int originalIndex = Items.IndexOf(drawable);
|
||||
int currentIndex = originalIndex;
|
||||
|
||||
// local function to increment the index in the required direction, wrapping over extremities.
|
||||
|
Loading…
Reference in New Issue
Block a user