Fixed server ranking if you have 0 xp
This commit is contained in:
parent
3f76106ec1
commit
747b68114a
@ -40,7 +40,13 @@ namespace NadekoBot.Services.Database.Repositories.Impl
|
|||||||
public int GetUserGuildRanking(ulong userId, ulong guildId)
|
public int GetUserGuildRanking(ulong userId, ulong guildId)
|
||||||
{
|
{
|
||||||
if (!_set.Where(x => x.GuildId == guildId && x.UserId == userId).Any())
|
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
|
return _set
|
||||||
.Where(x => x.GuildId == guildId)
|
.Where(x => x.GuildId == guildId)
|
||||||
|
Loading…
Reference in New Issue
Block a user