mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Ensure CurrentTrack is never null
This commit is contained in:
@ -95,10 +95,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
base.Update();
|
||||
|
||||
if (musicController.TrackLoaded)
|
||||
{
|
||||
Debug.Assert(musicController.CurrentTrack != null);
|
||||
marker.X = (float)(editorClock.CurrentTime / musicController.CurrentTrack.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,8 +136,8 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
AddUntilStep("Wait for music controller", () => Game.MusicController.IsLoaded);
|
||||
AddStep("Seek close to end", () =>
|
||||
{
|
||||
Game.MusicController.SeekTo(MusicController.CurrentTrack.AsNonNull().Length - 1000);
|
||||
MusicController.CurrentTrack.AsNonNull().Completed += () => trackCompleted = true;
|
||||
Game.MusicController.SeekTo(MusicController.CurrentTrack.Length - 1000);
|
||||
MusicController.CurrentTrack.Completed += () => trackCompleted = true;
|
||||
});
|
||||
|
||||
AddUntilStep("Track was completed", () => trackCompleted);
|
||||
|
@ -169,7 +169,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
if (timingPoints.Count == 0) return 0;
|
||||
|
||||
if (timingPoints[^1] == current)
|
||||
return (int)Math.Ceiling((musicController.CurrentTrack.AsNonNull().Length - current.Time) / current.BeatLength);
|
||||
return (int)Math.Ceiling((musicController.CurrentTrack.Length - current.Time) / current.BeatLength);
|
||||
|
||||
return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength);
|
||||
}
|
||||
|
Reference in New Issue
Block a user