diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 39483d62e5..48a98a371b 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -1491,7 +1491,6 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu case PLAY_MODE_ENDLESS: { CHECKPOINT; - StepsType st = GetCurrentStyleDef()->m_StepsType; Course* pCourse = m_pCurCourse; ASSERT( pCourse ); Trail *pTrail = m_pCurTrail[pn]; @@ -1527,7 +1526,6 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu // Find Personal Records if( PROFILEMAN->IsUsingProfile( pn ) ) { - Trail *pTrail = pCourse->GetTrail( st, cd ); HighScoreList &hsl = pProf->GetCourseHighScoreList( pCourse, pTrail ); for( unsigned i=0; im_pCurCourse; + set asDiff; GetCourseDifficultiesToShow( asDiff ); CourseDifficulty cd = m_PreferredCourseDifficulty[pn]; - do { + while( 1 ) + { cd = (CourseDifficulty)(cd+dir); if( cd < 0 || cd >= NUM_COURSE_DIFFICULTIES ) return false; - } while( asDiff.find(cd) == asDiff.end() ); + if( asDiff.find(cd) == asDiff.end() ) + continue; /* not available */ + if( !pCourse || pCourse->HasCourseDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, cd ) ) + break; + } return ChangePreferredCourseDifficulty( pn, cd ); }