From cc1f3d54b017be1193919eb1953c6f11d1ce66f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Dec 2018 22:37:09 +0900 Subject: [PATCH] Fix looping failure --- osu.Game/Screens/Multi/Multiplayer.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 40f66811f7..499198d800 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -134,9 +134,18 @@ namespace osu.Game.Screens.Multi Content.ScaleTo(1.1f, 250, Easing.InSine); Content.FadeOut(250); + cancelLooping(); + base.OnSuspending(next); } + private void cancelLooping() + { + var track = Beatmap.Value.Track; + if (track != null) + track.Looping = false; + } + protected override void LogoExiting(OsuLogo logo) { // the wave overlay transition takes longer than expected to run. @@ -148,6 +157,8 @@ namespace osu.Game.Screens.Multi { base.Update(); + if (!IsCurrentScreen) return; + if (currentScreen is MatchSubScreen) { var track = Beatmap.Value.Track; @@ -180,11 +191,7 @@ namespace osu.Game.Screens.Multi private void screenRemoved(Screen newScreen) { if (currentScreen is MatchSubScreen) - { - var track = Beatmap.Value.Track; - if (track != null) - track.Looping = false; - } + cancelLooping(); currentScreen = (OsuScreen)newScreen; }