Skip to content

Commit 95d3d96

Browse files
Merge pull request #80 from cetteup/fix/dont-grant-unlock-points-for-multiple-badge-levels
fix: Grant unlock point per badge instead of per badge level
2 parents df86f71 + d2bc731 commit 95d3d96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/ASP/aspx/getunlocksinfo.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ function getBonusUnlockCountByBadges($pid, $rank, $connection)
252252
// Count number of kit badges obtained
253253
$checkawds = implode(",", $kitbadges);
254254
$query = <<<SQL
255-
SELECT COUNT(`award_id`) AS `count`
255+
-- Using DISTINCT here to ensure we never return more than 7 unlock points based on badges
256+
-- Without DISTINCT, we'd return up to 14 points ($level = 2 and player has all level 2 + 3 badges)
257+
SELECT COUNT(DISTINCT `award_id`) AS `count`
256258
FROM `player_award`
257259
WHERE `player_id` = $pid
258260
AND (

0 commit comments

Comments
 (0)