Skip to content

Commit aac0048

Browse files
authored
Merge pull request #2359 from ZeroK-RTS/badger-badger-badger
Donation badger only for actual donators
2 parents 875e089 + ce62572 commit aac0048

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ZkData/Ef/Account.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ public int AvailableXP
235235
[NotMapped]
236236
public int KudosGained { get { return ContributionsByAccountID.Sum(x => (int?)x.KudosValue) ?? 0; } }
237237

238+
[NotMapped]
239+
public int KudosDonated { get { return ContributionsByAccountID.Where(x => x.ManuallyAddedAccountID == null).Sum(x => (int?)x.KudosValue) ?? 0; } }
240+
238241
[NotMapped]
239242
public int KudosSpent { get { return KudosPurchases.Sum(x => (int?)x.KudosValue) ?? 0; } }
240243

@@ -654,7 +657,7 @@ public List<BadgeType> GetBadges()
654657
var ret = new List<BadgeType>();
655658
if (Level > 200) ret.Add(BadgeType.player_level);
656659
if ((GetRating(RatingCategory.MatchMaking).Rank <= 3 || GetRating(RatingCategory.Casual).Rank <= 3)) ret.Add(BadgeType.player_elo);
657-
var total = HasKudos ? KudosGained : 0;
660+
var total = HasKudos ? KudosDonated : 0;
658661

659662
if (total >= GlobalConst.KudosForDiamond) ret.Add(BadgeType.donator_3);
660663
else if (total >= GlobalConst.KudosForGold) ret.Add(BadgeType.donator_2);

0 commit comments

Comments
 (0)