ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.33k stars 2.28k forks source link

Next track button always goes to the same track after 2024.718.0 #28935

Closed sbreaks closed 3 months ago

sbreaks commented 3 months ago

Type

Game behaviour

Bug description

Pressing f5 or clicking the next track button in the now playing tab always starts the same track, specifically this one. When a track ends normally (without pressing next) it does not have this issue.

Screenshots or videos

https://github.com/user-attachments/assets/ec388f1a-54e9-47b0-be4c-1a112072e3c1

Version

2024.718.0

Logs

compressed-logs.zip

frenzibyte commented 3 months ago

The conditional looks to be flipped:

diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs
index b6553779bc..d9bb92b4b7 100644
--- a/osu.Game/Overlays/MusicController.cs
+++ b/osu.Game/Overlays/MusicController.cs
@@ -316,7 +316,7 @@ private bool next(bool allowProtectedTracks)

             queuedDirection = TrackChangeDirection.Next;

-            var playableSet = getBeatmapSets().AsEnumerable().SkipWhile(i => !i.Equals(current?.BeatmapSetInfo) && (!i.Protected || allowProtectedTracks)).ElementAtOrDefault(1)
+            var playableSet = getBeatmapSets().AsEnumerable().SkipWhile(i => !i.Equals(current?.BeatmapSetInfo) || (i.Protected && !allowProtectedTracks)).ElementAtOrDefault(1)
                               ?? getBeatmapSets().AsEnumerable().FirstOrDefault(i => !i.Protected || allowProtectedTracks);

             var playableBeatmap = playableSet?.Beatmaps.FirstOrDefault();

When protected tracks are not allowed, protected beatmaps should be filtered out with SkipWhile. cc @bdach