Apparently `Compare()` doesn't return -1/0/1 as expected from a comparer, but some kind of string distance, which is not what we wanted here.
This commit is contained in:
JustArchi
2019-03-18 21:44:26 +01:00
parent 9655598e61
commit b231237554

View File

@@ -2127,7 +2127,7 @@ namespace ArchiSteamFarm {
while (!string.IsNullOrEmpty(key)) {
string startingKey = key;
using (IEnumerator<Bot> botsEnumerator = Bot.Bots.Where(bot => (bot.Value != Bot) && !rateLimitedBots.Contains(bot.Value) && bot.Value.IsConnectedAndLoggedOn && bot.Value.Commands.Bot.HasPermission(steamID, BotConfig.EPermission.Operator)).OrderByDescending(bot => Bot.BotsComparer.Compare(bot.Key, Bot.BotName)).ThenBy(bot => bot.Key, Bot.BotsComparer).Select(bot => bot.Value).GetEnumerator()) {
using (IEnumerator<Bot> botsEnumerator = Bot.Bots.Where(bot => (bot.Value != Bot) && !rateLimitedBots.Contains(bot.Value) && bot.Value.IsConnectedAndLoggedOn && bot.Value.Commands.Bot.HasPermission(steamID, BotConfig.EPermission.Operator)).OrderByDescending(bot => Bot.BotsComparer.Compare(bot.Key, Bot.BotName) > 0).ThenBy(bot => bot.Key, Bot.BotsComparer).Select(bot => bot.Value).GetEnumerator()) {
Bot currentBot = Bot;
while (!string.IsNullOrEmpty(key) && (currentBot != null)) {