1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 18:27:26 +08:00

Ensure user is returned to the RoomSubScreen before gameplay is started

This covers the scenario where a user may be at the song select screen
while another user (the room host) starts the match. This was only made
possible with the new queue modes, so is quite a recent regression.
This commit is contained in:
Dean Herbert 2021-12-06 14:03:51 +09:00
parent a76cfbea21
commit 0ea7a69084

View File

@ -319,6 +319,16 @@ namespace osu.Game.Screens.OnlinePlay.Match
protected void StartPlay()
{
// User may be at song select or otherwise when the host starts gameplay.
// Ensure that they first return to this screen, else global bindables (beatmap etc.) may be in a bad state.
if (!this.IsCurrentScreen())
{
this.MakeCurrent();
Schedule(StartPlay);
return;
}
sampleStart?.Play();
// fallback is to allow this class to operate when there is no parent OnlineScreen (testing purposes).