From 940433a9eed72796072e2ad448ba5f236c55de10 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 6 Aug 2021 01:52:44 -0500 Subject: don't add players to leaderboards leaderboards when they aren't on any --- build/database.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build/database.js') diff --git a/build/database.js b/build/database.js index 8543901..a12fc9e 100644 --- a/build/database.js +++ b/build/database.js @@ -403,14 +403,16 @@ async function getApplicableMemberLeaderboardAttributes(member) { // add the "leaderboards count" attribute const leaderboardsCount = Object.keys(applicableAttributes).length; const leaderboardsCountRequirement = await getLeaderboardRequirement('leaderboards_count', 'member'); - if ((leaderboardsCountRequirement.top_100 === null) - || (leaderboardsCount > leaderboardsCountRequirement.top_100)) + if (leaderboardsCount > 0 + && ((leaderboardsCountRequirement.top_100 === null) + || (leaderboardsCount > leaderboardsCountRequirement.top_100))) applicableAttributes['leaderboards_count'] = leaderboardsCount; // add the "first leaderboards count" attribute const top1LeaderboardsCount = Object.keys(applicableTop1Attributes).length; const top1LeaderboardsCountRequirement = await getLeaderboardRequirement('top_1_leaderboards_count', 'member'); - if ((top1LeaderboardsCountRequirement.top_100 === null) - || (top1LeaderboardsCount > top1LeaderboardsCountRequirement.top_100)) + if (top1LeaderboardsCount > 0 + && ((top1LeaderboardsCountRequirement.top_100 === null) + || (top1LeaderboardsCount > top1LeaderboardsCountRequirement.top_100))) applicableAttributes['top_1_leaderboards_count'] = top1LeaderboardsCount; return applicableAttributes; } -- cgit