mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Merge pull request #9544 from peppy/call-schedule-protected-next
Fix potential crash when trying to ensure music is playing
This commit is contained in:
commit
dd9211d6f0
@ -149,7 +149,7 @@ namespace osu.Game.Overlays
|
|||||||
if (beatmap.Disabled)
|
if (beatmap.Disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
next();
|
NextTrack();
|
||||||
}
|
}
|
||||||
else if (!IsPlaying)
|
else if (!IsPlaying)
|
||||||
{
|
{
|
||||||
@ -217,6 +217,9 @@ namespace osu.Game.Overlays
|
|||||||
/// <returns>The <see cref="PreviousTrackResult"/> that indicate the decided action.</returns>
|
/// <returns>The <see cref="PreviousTrackResult"/> that indicate the decided action.</returns>
|
||||||
private PreviousTrackResult prev()
|
private PreviousTrackResult prev()
|
||||||
{
|
{
|
||||||
|
if (beatmap.Disabled)
|
||||||
|
return PreviousTrackResult.None;
|
||||||
|
|
||||||
var currentTrackPosition = current?.Track.CurrentTime;
|
var currentTrackPosition = current?.Track.CurrentTime;
|
||||||
|
|
||||||
if (currentTrackPosition >= restart_cutoff_point)
|
if (currentTrackPosition >= restart_cutoff_point)
|
||||||
@ -248,6 +251,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private bool next()
|
private bool next()
|
||||||
{
|
{
|
||||||
|
if (beatmap.Disabled)
|
||||||
|
return false;
|
||||||
|
|
||||||
queuedDirection = TrackChangeDirection.Next;
|
queuedDirection = TrackChangeDirection.Next;
|
||||||
|
|
||||||
var playable = BeatmapSets.SkipWhile(i => i.ID != current.BeatmapSetInfo.ID).ElementAtOrDefault(1) ?? BeatmapSets.FirstOrDefault();
|
var playable = BeatmapSets.SkipWhile(i => i.ID != current.BeatmapSetInfo.ID).ElementAtOrDefault(1) ?? BeatmapSets.FirstOrDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user