Skip to content

Commit

Permalink
use etterna highscore save/load when saving an etterna profile
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 1, 2017
1 parent 2146655 commit 868f31a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2175,17 +2175,15 @@ XNode* Profile::SaveEttScoresCreateNode() const
XNode* pRateScores = new XNode(ssprintf("%f", rate));
FOREACH_CONST(HighScore, hsv, hs) {
const HighScore &chs = *hs;
pRateScores->AppendChild(chs.CreateNode());
pRateScores->AppendChild(chs.CreateEttNode());
}

pScores->AppendChild(pRateScores);
}
pChartKey->AppendChild(pScores);

// Chart entries may contain more than just scores, write out any scoregoals associated with this key

auto it = goalmap.find(ck);
if (it != goalmap.end()) {
if (goalmap.count(ck)) {
XNode* pGoals = new XNode("GoalTracker");
FOREACH_CONST(ScoreGoal, goalmap.at(ck), sg)
pGoals->AppendChild(sg->CreateNode());
Expand Down Expand Up @@ -2331,7 +2329,7 @@ void Profile::LoadEttScoresFromNode(const XNode* pSongScores) {
vector<HighScore> hsv;
FOREACH_CONST_Child(pRate, hs) {
hsv.resize(hsv.size() + 1);
hsv.back().LoadFromNode(hs);
hsv.back().LoadFromEttNode(hs);
}
if (!is_sorted(hsv.begin(), hsv.end())) {
sort(hsv.begin(), hsv.end());
Expand Down

0 comments on commit 868f31a

Please sign in to comment.