mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
Fix incorrect indexing
This commit is contained in:
parent
6775151c30
commit
76eff7f6b1
@ -622,7 +622,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
Debug.Assert(APIRoom != null);
|
Debug.Assert(APIRoom != null);
|
||||||
|
|
||||||
int index = APIRoom.Playlist.Where(p => p.ID == item.ID).Select((_, i) => i).Single();
|
int index = APIRoom.Playlist.Select((i, index) => (i, index)).Single(kvp => kvp.i.ID == item.ID).index;
|
||||||
APIRoom.Playlist.RemoveAt(index);
|
APIRoom.Playlist.RemoveAt(index);
|
||||||
APIRoom.Playlist.Insert(index, playlistItem);
|
APIRoom.Playlist.Insert(index, playlistItem);
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user