1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-01 21:15:07 +08:00

Always attempt to follow selection, even if difficulty name / metadata change

This commit is contained in:
Dean Herbert 2022-07-27 14:18:53 +09:00
parent 8105d4854a
commit 24d75612e2

View File

@ -283,18 +283,21 @@ namespace osu.Game.Screens.Select
foreach (var beatmapInfo in beatmapSetInfo.Beatmaps) foreach (var beatmapInfo in beatmapSetInfo.Beatmaps)
{ {
// Best effort matching. We can't use ID because in the update flow a new version will get its own GUID. if (!((IBeatmapMetadataInfo)beatmapInfo.Metadata).Equals(SelectedBeatmapInfo.Metadata))
bool selectionMatches = continue;
((IBeatmapMetadataInfo)beatmapInfo.Metadata).Equals(SelectedBeatmapInfo.Metadata)
&& beatmapInfo.DifficultyName == SelectedBeatmapInfo.DifficultyName;
if (selectionMatches) // Best effort matching. We can't use ID because in the update flow a new version will get its own GUID.
if (beatmapInfo.DifficultyName == SelectedBeatmapInfo.DifficultyName)
{ {
SelectBeatmap(beatmapInfo); SelectBeatmap(beatmapInfo);
break; return;
} }
} }
} }
// If a direct selection couldn't be made, it's feasible that the difficulty name (or beatmap metadata) changed.
// Let's attempt to follow set-level selection anyway.
SelectBeatmap(sender[changes.NewModifiedIndices.First()].Beatmaps.First());
} }
} }
} }