mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Fix possibly setting null track
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
@ -19,7 +20,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
private readonly TextureStore textures;
|
||||
|
||||
public DummyWorkingBeatmap(AudioManager audio, TextureStore textures)
|
||||
public DummyWorkingBeatmap([NotNull] AudioManager audio, TextureStore textures)
|
||||
: base(new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
|
@ -321,15 +321,13 @@ namespace osu.Game.Overlays
|
||||
private void changeTrack()
|
||||
{
|
||||
CurrentTrack.Expire();
|
||||
CurrentTrack = null;
|
||||
CurrentTrack = new DrawableTrack(new TrackVirtual(1000));
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
CurrentTrack = new DrawableTrack(current.GetRealTrack());
|
||||
CurrentTrack.Completed += () => onTrackCompleted(current);
|
||||
|
||||
AddInternal(CurrentTrack);
|
||||
}
|
||||
CurrentTrack.Completed += () => onTrackCompleted(current);
|
||||
AddInternal(CurrentTrack);
|
||||
}
|
||||
|
||||
private void onTrackCompleted(WorkingBeatmap workingBeatmap)
|
||||
|
Reference in New Issue
Block a user