diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 7adad56843..44e32d3472 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -202,6 +202,7 @@ enum RankingCategory #define DEFAULT_RANKING_NAME CString("") const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"}; +inline bool IsRankingToFillIn( CString sName ) { return !sName.empty() && sName[0]=='#'; } RankingCategory AverageMeterToRankingCategory( float fAverageMeter ); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index ce3e1902b4..188ad96de9 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -662,6 +662,10 @@ void SongManager::SaveCategoryRankingsToFile( CString fn ) m_CategoryDatas[st][rc].vHighScores.resize(NUM_RANKING_LINES); for( int l=0; lm_MemCardDatas[st][mc].vHighScores.resize(NUM_RANKING_LINES); for( int l=0; lm_MemCardDatas[st][mc].vHighScores[l].sName) ) + pCourse->m_MemCardDatas[st][mc].vHighScores[l].sName = ""; + FileWrite( f, pCourse->m_MemCardDatas[st][mc].vHighScores[l].sName ); FileWrite( f, pCourse->m_MemCardDatas[st][mc].vHighScores[l].iScore ); FileWrite( f, pCourse->m_MemCardDatas[st][mc].vHighScores[l].fSurviveTime ); @@ -766,6 +774,10 @@ void SongManager::SaveStepsMemCardDataToFile( CString fn, int mc ) pNotes->m_MemCardDatas[mc].vHighScores.resize(NUM_RANKING_LINES); for( int l=0; lm_MemCardDatas[mc].vHighScores[l].sName) ) + pNotes->m_MemCardDatas[mc].vHighScores[l].sName = ""; + FileWrite( f, pNotes->m_MemCardDatas[mc].vHighScores[l].sName ); FileWrite( f, pNotes->m_MemCardDatas[mc].vHighScores[l].grade ); FileWrite( f, pNotes->m_MemCardDatas[mc].vHighScores[l].iScore ); diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index b28a070ee9..09f38e442d 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -338,6 +338,11 @@ bool Steps::MemCardData::HighScore::operator>=( const Steps::MemCardData::HighSc void Steps::MemCardData::AddHighScore( Steps::MemCardData::HighScore hs, int &iIndexOut ) { int i; + for( i=0; i<(int)vHighScores.size(); i++ ) + { + ASSERT( vHighScores[i].sName != RANKING_TO_FILL_IN_MARKER[0] ); + } + for( i=0; i<(int)vHighScores.size(); i++ ) { if( hs >= vHighScores[i] ) // tie goes to new score