diff --git a/src/Profile.cpp b/src/Profile.cpp index 1e52bdc0b4..332516bf2b 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -1153,6 +1153,8 @@ ProfileLoadResult Profile::LoadAllFromDir( const RString &sDir, bool bRequireSig LoadEditableDataFromDir( sDir ); ProfileLoadResult ret= LoadEttFromDir(sDir, bRequireSignature); + if (ret != ProfileLoadResult_Success) + ret = LoadStatsFromDir(sDir, bRequireSignature); if (ret != ProfileLoadResult_Success) return ret; @@ -2095,48 +2097,48 @@ float Profile::CalculateCaloriesFromHeartRate(float HeartRate, float Duration) / 4.184f) * Duration; } -XNode* Profile::SaveSongScoresCreateNode() const -{ - CHECKPOINT_M("Getting the node to save song scores."); - - const Profile* pProfile = this; - ASSERT(pProfile != NULL); - - XNode* pNode = new XNode("SongScores"); - - FOREACHM_CONST(SongID, HighScoresForASong, m_SongHighScores, i) - { - const SongID &songID = i->first; - const HighScoresForASong &hsSong = i->second; - - // skip songs that have never been played - if (pProfile->GetSongNumTimesPlayed(songID) == 0) - continue; - - XNode* pSongNode = pNode->AppendChild(songID.CreateNode()); - - int jCheck2 = hsSong.m_StepsHighScores.size(); - int jCheck1 = 0; - FOREACHM_CONST(StepsID, HighScoresForASteps, hsSong.m_StepsHighScores, j) - { - jCheck1++; - ASSERT(jCheck1 <= jCheck2); - const StepsID &stepsID = j->first; - const HighScoresForASteps &hsSteps = j->second; - - const HighScoreList &hsl = hsSteps.hsl; - - // skip steps that have never been played - if (hsl.GetNumTimesPlayed() == 0) - continue; - - XNode* pStepsNode = pSongNode->AppendChild(stepsID.CreateNode()); - - pStepsNode->AppendChild(hsl.CreateNode()); - } - } - - return pNode; +XNode* Profile::SaveSongScoresCreateNode() const +{ + CHECKPOINT_M("Getting the node to save song scores."); + + const Profile* pProfile = this; + ASSERT(pProfile != NULL); + + XNode* pNode = new XNode("SongScores"); + + FOREACHM_CONST(SongID, HighScoresForASong, m_SongHighScores, i) + { + const SongID &songID = i->first; + const HighScoresForASong &hsSong = i->second; + + // skip songs that have never been played + if (pProfile->GetSongNumTimesPlayed(songID) == 0) + continue; + + XNode* pSongNode = pNode->AppendChild(songID.CreateNode()); + + int jCheck2 = hsSong.m_StepsHighScores.size(); + int jCheck1 = 0; + FOREACHM_CONST(StepsID, HighScoresForASteps, hsSong.m_StepsHighScores, j) + { + jCheck1++; + ASSERT(jCheck1 <= jCheck2); + const StepsID &stepsID = j->first; + const HighScoresForASteps &hsSteps = j->second; + + const HighScoreList &hsl = hsSteps.hsl; + + // skip steps that have never been played + if (hsl.GetNumTimesPlayed() == 0) + continue; + + XNode* pStepsNode = pSongNode->AppendChild(stepsID.CreateNode()); + + pStepsNode->AppendChild(hsl.CreateNode()); + } + } + + return pNode; } XNode* Profile::SaveEttScoresCreateNode() const