Skip to content

Commit

Permalink
fix(globalRanking): resolve incorrect rank shown for 1st row on non-d…
Browse files Browse the repository at this point in the history
…efault sort (#3200)
  • Loading branch information
wescopeland authored Feb 23, 2025
1 parent 04db9fa commit 03aec24
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions resources/views/pages-legacy/globalRanking.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,15 @@
if ($dataPoint['Points'] != $rankPoints) {
if ($rankPoints === null && $friends === 0 && $type === 2 && $offset > 0) {
// first rank of subsequent pages for all users / all time should be calculated
// as it might be shared with users on the previous page
$rankType = ($unlockMode == UnlockMode::Hardcore) ? RankType::Hardcore : RankType::Softcore;
$rank = getUserRank($dataPoint['User'], $rankType);
// The first rank of subsequent pages for all users / all time should be calculated,
// as it might be tied with users on the previous page.
// Values >10 indicate descending order, so we'll use modulo to get the base sort type.
$rank = match ($sort % 10) {
5 => getUserRank($dataPoint['User'], RankType::Hardcore),
2 => getUserRank($dataPoint['User'], RankType::Softcore),
6 => getUserRank($dataPoint['User'], RankType::TruePoints),
default => $rowRank
};
} else {
$rank = $rowRank;
}
Expand Down

0 comments on commit 03aec24

Please sign in to comment.