Skip to content

Commit ce62572

Browse files
authored
Donation badger only for actual donators
1 parent 7e8dcfb commit ce62572

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
@@ -234,6 +234,9 @@ public int AvailableXP
234234
[NotMapped]
235235
public int KudosGained { get { return ContributionsByAccountID.Sum(x => (int?)x.KudosValue) ?? 0; } }
236236

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

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

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

0 commit comments

Comments
 (0)