1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Fix crash when start button is repeatedly pressed

This commit is contained in:
smoogipoo 2019-02-08 15:39:11 +09:00
parent 99a7ccc01a
commit 6fe1f57236

View File

@ -83,7 +83,7 @@ namespace osu.Game.Screens.Multi
RelativeSizeAxes = Axes.Both, 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 }; Padding = new MarginPadding { Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING };
waves.AddRange(new Drawable[] waves.AddRange(new Drawable[]
@ -169,6 +169,14 @@ namespace osu.Game.Screens.Multi
Logger.Log($"Polling adjusted to {roomManager.TimeBetweenPolls}"); 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) public void APIStateChanged(APIAccess api, APIState state)
{ {
if (state != APIState.Online) if (state != APIState.Online)