From 747b68114a9f81638bfa3ca3a76ef8c198858ab8 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 26 Sep 2017 12:51:02 +0200 Subject: [PATCH] Fixed server ranking if you have 0 xp --- .../Services/Database/Repositories/Impl/XpRepository.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Services/Database/Repositories/Impl/XpRepository.cs b/src/NadekoBot/Services/Database/Repositories/Impl/XpRepository.cs index 64c78413..90160da1 100644 --- a/src/NadekoBot/Services/Database/Repositories/Impl/XpRepository.cs +++ b/src/NadekoBot/Services/Database/Repositories/Impl/XpRepository.cs @@ -40,7 +40,13 @@ namespace NadekoBot.Services.Database.Repositories.Impl public int GetUserGuildRanking(ulong userId, ulong guildId) { if (!_set.Where(x => x.GuildId == guildId && x.UserId == userId).Any()) - return _set.Count(); + { + var cnt = _set.Count(x => x.GuildId == guildId); + if (cnt == 0) + return 1; + else + return cnt; + } return _set .Where(x => x.GuildId == guildId)