Fix a similar case with online play sub-screens

This commit is contained in:
smoogipoo
2021-06-08 17:54:54 +09:00
parent 860f1aebb3
commit ab9290772b
2 changed files with 32 additions and 1 deletions

View File

@ -253,7 +253,10 @@ namespace osu.Game.Screens.OnlinePlay
public override bool OnBackButton()
{
if ((screenStack.CurrentScreen as IOnlinePlaySubScreen)?.OnBackButton() == true)
if (!(screenStack.CurrentScreen is IOnlinePlaySubScreen onlineSubScreen))
return false;
if (((Drawable)onlineSubScreen).IsLoaded && onlineSubScreen.AllowBackButton && onlineSubScreen.OnBackButton())
return true;
if (screenStack.CurrentScreen != null && !(screenStack.CurrentScreen is LoungeSubScreen))