From 6fe1f572367dece51712199783e8d1ce19174e7b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 8 Feb 2019 15:39:11 +0900 Subject: [PATCH] Fix crash when start button is repeatedly pressed --- osu.Game/Screens/Multi/Multiplayer.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 19cb550e7b..360dd1fa07 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -83,7 +83,7 @@ namespace osu.Game.Screens.Multi RelativeSizeAxes = Axes.Both, }; - screenStack = new ScreenStack(loungeSubScreen = new LoungeSubScreen(this.Push)) { RelativeSizeAxes = Axes.Both }; + screenStack = new ScreenStack(loungeSubScreen = new LoungeSubScreen(pushGameplayScreen)) { RelativeSizeAxes = Axes.Both }; Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING }; waves.AddRange(new Drawable[] @@ -169,6 +169,14 @@ namespace osu.Game.Screens.Multi Logger.Log($"Polling adjusted to {roomManager.TimeBetweenPolls}"); } + private void pushGameplayScreen(IScreen gameplayScreen) + { + if (!this.IsCurrentScreen()) + return; + + this.Push(gameplayScreen); + } + public void APIStateChanged(APIAccess api, APIState state) { if (state != APIState.Online)