mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 13:02:54 +08:00
Merge pull request #21338 from RATCM/fix-leaderboard-filter
Match leaderboard filter behaviour to web
This commit is contained in:
commit
4a79141824
@ -204,10 +204,11 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
}
|
}
|
||||||
else if (filterMods)
|
else if (filterMods)
|
||||||
{
|
{
|
||||||
// otherwise find all the scores that have *any* of the currently selected mods (similar to how web applies mod filters)
|
// otherwise find all the scores that have all of the currently selected mods (similar to how web applies mod filters)
|
||||||
// we're creating and using a string list representation of selected mods so that it can be translated into the DB query itself
|
// we're creating and using a string HashSet representation of selected mods so that it can be translated into the DB query itself
|
||||||
var selectedMods = mods.Value.Select(m => m.Acronym);
|
var selectedMods = mods.Value.Select(m => m.Acronym).ToHashSet();
|
||||||
scores = scores.Where(s => s.Mods.Any(m => selectedMods.Contains(m.Acronym)));
|
|
||||||
|
scores = scores.Where(s => selectedMods.SetEquals(s.Mods.Select(m => m.Acronym)));
|
||||||
}
|
}
|
||||||
|
|
||||||
scores = scoreManager.OrderByTotalScore(scores.Detach());
|
scores = scoreManager.OrderByTotalScore(scores.Detach());
|
||||||
|
Loading…
Reference in New Issue
Block a user