diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 812cc0564f..3cd0b8db4f 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -589,7 +589,7 @@ void Profile::IncrementCategoryPlayCount( StepsType st, RankingCategory rc ) #define WARN_AND_CONTINUE_M(m) { WARN_M(m); continue; } #define WARN_AND_BREAK_M(m) { WARN_M(m); break; } #define LOAD_NODE(X) { \ - XNode* X = xml.GetChild(#X); \ + const XNode* X = xml->GetChild(#X); \ if( X==NULL ) LOG->Warn("Failed to read section " #X); \ else Load##X##FromNode(X); } @@ -655,14 +655,19 @@ Profile::LoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignatur } LOG->Trace( "Done." ); + return LoadStatsXmlFromNode( &xml ); +} + +Profile::LoadResult Profile::LoadStatsXmlFromNode( const XNode *xml ) +{ /* The placeholder stats.xml file has an tag. Don't load it, but don't * warn about it. */ - if( xml.m_sName == "html" ) + if( xml->m_sName == "html" ) return failed_no_profile; - if( xml.m_sName != "Stats" ) + if( xml->m_sName != "Stats" ) { - WARN_M( xml.m_sName ); + WARN_M( xml->m_sName ); return failed_tampered; } diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index afb2c6a9bd..334bbdbc31 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -267,6 +267,7 @@ public: bool SaveAllToDir( CString sDir, bool bSignData ) const; void LoadEditableDataFromDir( CString sDir ); + LoadResult LoadStatsXmlFromNode( const XNode* pNode ); void LoadGeneralDataFromNode( const XNode* pNode ); void LoadSongScoresFromNode( const XNode* pNode ); void LoadCourseScoresFromNode( const XNode* pNode );