mirror of
https://github.com/ppy/osu
synced 2025-01-13 01:21:08 +00:00
Ensure one non-expired item when switching to host-only
This commit is contained in:
parent
dbc23e224f
commit
4aaf412ac9
@ -387,8 +387,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
if (newMode == QueueModes.HostOnly)
|
||||
{
|
||||
// Remove all but the current and expired items. The current item may be re-used for host-only mode if it's non-expired.
|
||||
foreach (var playlistItem in playlistItems.Where(i => !i.Expired && i.ID != currentItem.ID).ToArray())
|
||||
await ((IMultiplayerClient)this).PlaylistItemRemoved(playlistItem.ID).ConfigureAwait(false);
|
||||
|
||||
// Always ensure that at least one non-expired item exists by duplicating the current item if required.
|
||||
if (currentItem.Expired)
|
||||
await duplicateCurrentItem().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
// When changing modes, items could have been added (above) or the queueing order could have changed.
|
||||
|
Loading…
Reference in New Issue
Block a user