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.
This commit is contained in:
Crash Cringle
2023-03-24 12:08:41 -04:00
committed by teejusb
parent f95df04d9e
commit 980c3a4c3a
+6
View File
@@ -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);
}