Fix non-hosts crashing on load requested

`onLoadRequested()` always released the `readyClickOperation` ongoing
operation, without checking whether it actually needs to/should (it
should only do so if the action initiating the operation was starting
the game by the host). This would crash all other consumers, who already
released the operation when their ready-up operation completed server
side.

To resolve, relax the constraint such that the operation can be ended
multiple times in any order. At the end of the day the thing that
matters is that the operation is done and the ready button is unblocked.
This commit is contained in:
Bartłomiej Dach 2021-01-13 00:58:53 +01:00
parent becd52b5d2
commit 2d3cacca11

View File

@ -241,8 +241,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
void endOperation()
{
Debug.Assert(readyClickOperation != null);
readyClickOperation.Dispose();
readyClickOperation?.Dispose();
readyClickOperation = null;
}
}
@ -255,9 +254,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
StartPlay(() => new MultiplayerPlayer(SelectedItem.Value, userIds));
Debug.Assert(readyClickOperation != null);
readyClickOperation.Dispose();
readyClickOperation?.Dispose();
readyClickOperation = null;
}