Skip to content

Commit

Permalink
temporary measure to prevent incorrect pb pointers on profile load un…
Browse files Browse the repository at this point in the history
…til i figure out where i want to reliably assign it
  • Loading branch information
MinaciousGrace committed May 29, 2017
1 parent fb39253 commit 071c8f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ScoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 071c8f0

Please sign in to comment.