From 2d74609f5030b07844fab427bb4f11e7915ebdbd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Jan 2020 19:06:50 +0900 Subject: [PATCH] Fix crash due to misordered selection events --- osu.Game/Screens/Select/BeatmapCarousel.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 4433543ca1..420aa14a99 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -559,6 +559,14 @@ namespace osu.Game.Screens.Select { if (state.NewValue == CarouselItemState.Selected) { + if (!AllowSelection) + { + // CarouselBeatmap may trigger a state change from OnClick, unaware that it is not allowed to. + // we revert this change here to ensure sanity. + c.State.Value = state.OldValue; + return; + } + selectedBeatmapSet = set; SelectionChanged?.Invoke(c.Beatmap);