From 071c8f0dc644b182f7c8d6fddc89e6aa90c98054 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sun, 28 May 2017 21:46:01 -0400 Subject: [PATCH] temporary measure to prevent incorrect pb pointers on profile load until i figure out where i want to reliably assign it --- src/ScoreManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ScoreManager.cpp b/src/ScoreManager.cpp index 2976757cf5..3701439390 100644 --- a/src/ScoreManager.cpp +++ b/src/ScoreManager.cpp @@ -319,9 +319,14 @@ void ScoresAtRate::LoadFromNode(const XNode* node, const string& ck, const float p->GetAttrValue("Key", sk); scores[sk].LoadFromEttNode(p); - // Set first score as the pbptr + // Set any pb if(PBptr == nullptr) PBptr = &scores.find(sk)->second; + else { + // update pb if a better score is found + if (PBptr->GetWifeScore() < scores[sk].GetWifeScore()) + PBptr = &scores.find(sk)->second; + } // Fill in stuff for the highscores scores[sk].SetChartKey(ck);