Fixed .srm, closes #1373

This commit is contained in:
Master Kwoth 2017-07-10 21:31:47 +02:00
parent 9a744172a9
commit 34b56c6353
2 changed files with 5 additions and 3 deletions

View File

@ -480,9 +480,10 @@ namespace NadekoBot.Services.Music
lock (locker)
{
var cur = Queue.Current;
var toReturn = Queue.RemoveAt(index);
if (cur.Index == index)
Next();
return Queue.RemoveAt(index);
return toReturn;
}
}

View File

@ -95,11 +95,12 @@ namespace NadekoBot.Services.Music
if (index < 0 || index >= Songs.Count)
throw new ArgumentOutOfRangeException(nameof(index));
var current = Songs.First;
var current = Songs.First.Value;
for (int i = 0; i < Songs.Count; i++)
{
if (i == index)
{
current = Songs.ElementAt(index);
Songs.Remove(current);
if (CurrentIndex != 0)
{
@ -111,7 +112,7 @@ namespace NadekoBot.Services.Music
break;
}
}
return current.Value;
return current;
}
}