Skip to content

Commit 46b913d

Browse files
only save scoregoal nodes if there are indeed goals in the node and standardize some checkpoints messages
1 parent 6140fd2 commit 46b913d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Profile.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,12 @@ XNode* Profile::SavePermaMirrorCreateNode() const {
14321432

14331433
XNode* GoalsForChart::CreateNode() const {
14341434
XNode* cg = new XNode("GoalsForChart");
1435-
cg->AppendAttr("Key", goals[0].chartkey);
1436-
FOREACH_CONST(ScoreGoal, goals, sg)
1437-
cg->AppendChild(sg->CreateNode());
1435+
1436+
if (!goals.empty()) {
1437+
cg->AppendAttr("Key", goals[0].chartkey);
1438+
FOREACH_CONST(ScoreGoal, goals, sg)
1439+
cg->AppendChild(sg->CreateNode());
1440+
}
14381441
return cg;
14391442
}
14401443

@@ -2123,7 +2126,7 @@ void Profile::ImportScoresToEtterna() {
21232126
}
21242127

21252128
XNode* Profile::SaveEttScoresCreateNode() const {
2126-
CHECKPOINT_M("Getting the node to save song scores.");
2129+
CHECKPOINT_M("Saving the player scores node.");
21272130

21282131
const Profile* pProfile = this;
21292132
ASSERT(pProfile != NULL);
@@ -2132,7 +2135,7 @@ XNode* Profile::SaveEttScoresCreateNode() const {
21322135
}
21332136

21342137
void Profile::LoadEttScoresFromNode(const XNode* pSongScores) {
2135-
CHECKPOINT_M("Loading the node that contains song scores.");
2138+
CHECKPOINT_M("Loading the player scores node.");
21362139
SCOREMAN->LoadFromNode(pSongScores);
21372140
}
21382141

@@ -2621,7 +2624,7 @@ class LunaProfile : public Luna<Profile>
26212624
static int IsCurrentChartPermamirror(T* p, lua_State *L) {
26222625
bool o = false;
26232626
const string& ck = GAMESTATE->m_pCurSteps[PLAYER_1]->GetChartKey();
2624-
if (p->PermaMirrorCharts.count(ck));
2627+
if (p->PermaMirrorCharts.count(ck))
26252628
o = true;
26262629

26272630
lua_pushboolean(L, o);

0 commit comments

Comments
 (0)