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

Fix song select not correctly playing tracks in some cases

This commit is contained in:
Dean Herbert 2019-10-08 10:40:52 +09:00
parent 84c13b93fc
commit e7fc5e556c

View File

@ -412,9 +412,6 @@ namespace osu.Game.Screens.Select
WorkingBeatmap previous = Beatmap.Value; WorkingBeatmap previous = Beatmap.Value;
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, previous); Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, previous);
if (this.IsCurrentScreen() && Beatmap.Value?.Track != previous?.Track)
ensurePlayingSelected(true);
if (beatmap != null) if (beatmap != null)
{ {
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID) if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
@ -424,6 +421,9 @@ namespace osu.Game.Screens.Select
} }
} }
if (this.IsCurrentScreen())
ensurePlayingSelected();
UpdateBeatmap(Beatmap.Value); UpdateBeatmap(Beatmap.Value);
} }
} }
@ -581,19 +581,14 @@ namespace osu.Game.Screens.Select
beatmap.Track.Looping = true; beatmap.Track.Looping = true;
} }
private void ensurePlayingSelected(bool restart = false) private void ensurePlayingSelected()
{ {
Track track = Beatmap.Value.Track; Track track = Beatmap.Value.Track;
if (!track.IsRunning)
{
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime; track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
if (restart) if (!track.IsRunning)
track.Restart(); track.Restart();
else
track.Start();
}
} }
private void onBeatmapSetAdded(BeatmapSetInfo s) => Carousel.UpdateBeatmapSet(s); private void onBeatmapSetAdded(BeatmapSetInfo s) => Carousel.UpdateBeatmapSet(s);