mirror of https://github.com/ppy/osu
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:
parent
a76cfbea21
commit
0ea7a69084
|
@ -319,6 +319,16 @@ public override bool OnExiting(IScreen next)
|
|||
|
||||
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).
|
||||
|
|
Loading…
Reference in New Issue