From 998779203a7944359cfc37bc59499da7e8340f09 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 10 Aug 2022 12:31:52 +0200 Subject: [PATCH] Fixed users not gaining club xp --- src/Nadeko.Econ/Gambling/Slot/SlotGame.cs | 3 +++ src/NadekoBot/Modules/Xp/XpService.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/Nadeko.Econ/Gambling/Slot/SlotGame.cs b/src/Nadeko.Econ/Gambling/Slot/SlotGame.cs index b10d7154f..6a1567bb2 100644 --- a/src/Nadeko.Econ/Gambling/Slot/SlotGame.cs +++ b/src/Nadeko.Econ/Gambling/Slot/SlotGame.cs @@ -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(); diff --git a/src/NadekoBot/Modules/Xp/XpService.cs b/src/NadekoBot/Modules/Xp/XpService.cs index 34640038f..f3a9d596d 100644 --- a/src/NadekoBot/Modules/Xp/XpService.cs +++ b/src/NadekoBot/Modules/Xp/XpService.cs @@ -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); }