diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 406df0071c..288f6f4f80 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -922,19 +922,24 @@ void Course::UpdateCourseStats() SortOrder_TotalDifficulty = 999999; // large number return; } - SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter(); } SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages(); if (GetEstimatedNumStages() > 7) SortOrder_Ranking = 3; - CStringArray RankingCourses; + // HACK: this function takes a while to execute because of + // the ranking portion at the end. Do so only if it is + // absolutely necessary. + if (PREFSMAN->m_iCourseSortOrder == PrefsManager::COURSE_SORT_RANK) + { + CStringArray RankingCourses; - split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses); + split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses); - for(i = 0; i < RankingCourses.size(); i++) - if (!RankingCourses[i].CompareNoCase(this->m_sPath)) - SortOrder_Ranking = 1; + for(i = 0; i < RankingCourses.size(); i++) + if (!RankingCourses[i].CompareNoCase(this->m_sPath)) + SortOrder_Ranking = 1; + } } \ No newline at end of file