From 980c3a4c3aeee768911bd04e8f7ccc71a56f7d90 Mon Sep 17 00:00:00 2001 From: Crash Cringle <30600688+CrashCringle12@users.noreply.github.com> Date: Fri, 24 Mar 2023 12:08:41 -0400 Subject: [PATCH] MergeFromOtherHSL() now 'Removes All But One Of Each Name' per preference When merging two high score lists, the MergeFromOtherHSL() function only called ClampSize() but did not also call RemoveAllButOneOfEachName. This behavior was okay before because RemoveAllButOneOfEachName() was called on every single song on the machine every set. Since this is no longer behavior, we need to make sure this method calls this otherwise we may end up with a merged leaderboard that has the same person occuring more than once. --- src/HighScore.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/HighScore.cpp b/src/HighScore.cpp index 2ac44e775c..f87906da2a 100644 --- a/src/HighScore.cpp +++ b/src/HighScore.cpp @@ -445,6 +445,12 @@ void HighScoreList::MergeFromOtherHSL(HighScoreList& other, bool is_machine) vHighScores.erase(unique_end, vHighScores.end()); // Reverse it because sort moved the lesser scores to the top. std::reverse(vHighScores.begin(), vHighScores.end()); + + if (!PREFSMAN->m_bAllowMultipleHighScoreWithSameName) + { + // erase all but the highest score for each name + RemoveAllButOneOfEachName(); + } ClampSize(is_machine); }