From 71d985f86109b937fbe11f376fb7a6792c1cca68 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 3 Aug 2005 03:23:21 +0000 Subject: [PATCH] cleanup --- stepmania/src/ProfileManager.cpp | 7 ++++++- stepmania/src/SongUtil.cpp | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index c92b4f77de..1fc219797f 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -286,7 +286,12 @@ const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const { ASSERT( pn >= 0 && pn < NUM_PLAYERS ); - if( m_sProfileDir[pn].empty() || ProfileWasLoadedFromMemoryCard(pn) ) + if( m_sProfileDir[pn].empty() ) + { + // return an empty profile + return m_pMemoryCardProfile[pn]; + } + else if( ProfileWasLoadedFromMemoryCard(pn) ) { return m_pMemoryCardProfile[pn]; } diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index ed7e235ff2..911d138e28 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -123,7 +123,10 @@ void SongUtil::SortSongPointerArrayByGrades( vector &vpSongsInOut, bool b Song *pSong = vpSongsInOut[i]; int iCounts[NUM_GRADES]; - PROFILEMAN->GetMachineProfile()->GetGrades( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, iCounts ); + const Profile *pProfile = PROFILEMAN->GetMachineProfile(); + const Style *pStyle = GAMESTATE->GetCurrentStyle(); + StepsType st = pStyle->m_StepsType; + pProfile->GetGrades( pSong, st, iCounts ); CString foo; foo.reserve(256);