1
0
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:
smoogipoo 2021-10-22 21:57:29 +09:00
parent 6775151c30
commit 76eff7f6b1

View File

@ -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);