Fixed users not gaining club xp

This commit is contained in:
Kwoth
2022-08-10 12:31:52 +02:00
parent e0e4d697c3
commit 998779203a
2 changed files with 10 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
namespace Nadeko.Econ.Gambling;
//here is a payout chart
//https://lh6.googleusercontent.com/-i1hjAJy_kN4/UswKxmhrbPI/AAAAAAAAB1U/82wq_4ZZc-Y/DE6B0895-6FC1-48BE-AC4F-14D1B91AB75B.jpg
//thanks to judge for helping me with this
public class SlotGame
{
private static readonly NadekoRandom _rng = new NadekoRandom();

View File

@@ -188,6 +188,13 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
},
(_, n) => n);
await ctx.Clubs
.Where(x => x.Members.Any(m => group.Contains(m.UserId)))
.UpdateAsync(old => new()
{
Xp = old.Xp + (group.Key * old.Members.Count(m => group.Contains(m.UserId)))
});
dus.AddRange(items);
}