From 1751532a01a41547ac2a96b23731b4bcc71ddc3a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 7 Mar 2017 13:30:36 +0900 Subject: [PATCH] Fix a few regressions. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 3 ++- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 2 +- osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 665598ea66..13eb069e2b 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -91,7 +91,8 @@ public void TestImportWhenFileOpen() Assert.IsTrue(File.Exists(temp)); - osu.Dependencies.Get().Import(temp); + using (File.OpenRead(temp)) + osu.Dependencies.Get().Import(temp); ensureLoaded(osu); diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 4273898251..95a263463a 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -68,7 +68,7 @@ public void BlurTo(Vector2 sigma, double duration, EasingTypes easing = EasingTy public override bool Equals(BackgroundScreen other) { - var otherBeatmapBackground = (BackgroundScreenBeatmap)other; + var otherBeatmapBackground = other as BackgroundScreenBeatmap; if (otherBeatmapBackground == null) return false; return base.Equals(other) && beatmap == otherBeatmapBackground.Beatmap; diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs index 3273f8299a..dd377938a7 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs @@ -17,7 +17,7 @@ public BackgroundScreenCustom(string textureName) public override bool Equals(BackgroundScreen other) { - var backgroundScreenCustom = (BackgroundScreenCustom)other; + var backgroundScreenCustom = other as BackgroundScreenCustom; if (backgroundScreenCustom == null) return false; return base.Equals(other) && textureName == backgroundScreenCustom.textureName;