From f261a077d2ff613136b84206ddc94332e28756c1 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 26 Apr 2017 20:22:03 +0900 Subject: [PATCH] General fixes/cleanup in Player. --- osu.Game/Screens/Play/Player.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7d001d16bf..37b4cf5b45 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -92,9 +92,6 @@ namespace osu.Game.Screens.Play if (Beatmap?.Beatmap == null) throw new Exception("Beatmap was not loaded"); - if (Beatmap?.Beatmap?.HitObjects.Count == 0) - throw new Exception("No valid objects were found!"); - ruleset = osu?.Ruleset.Value ?? Beatmap.BeatmapInfo.Ruleset; rulesetInstance = ruleset.CreateInstance(); @@ -110,6 +107,9 @@ namespace osu.Game.Screens.Play rulesetInstance = ruleset.CreateInstance(); HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap); } + + if (!HitRenderer.Objects.Any()) + throw new Exception("Beatmap contains no hit objects!"); } catch (Exception e) { @@ -167,10 +167,7 @@ namespace osu.Game.Screens.Play hudOverlay.Progress.Objects = HitRenderer.Objects; hudOverlay.Progress.AudioClock = decoupledClock; hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded; - hudOverlay.Progress.OnSeek = pos => - { - decoupledClock.Seek(pos); - }; + hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); //bind HitRenderer to ScoreProcessor and ourselves (for a pass situation) HitRenderer.OnAllJudged += onCompletion; @@ -355,7 +352,6 @@ namespace osu.Game.Screens.Play initializeSkipButton(); }); - //keep in mind this is using the interpolatedSourceClock so won't be run as early as we may expect. hitRendererContainer.Alpha = 0; hitRendererContainer.FadeIn(750, EasingTypes.OutQuint); }