From 7b6204243d56c401c8e7af7ca3b92a8ea38e8b76 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 4 Aug 2003 20:45:34 +0000 Subject: [PATCH] simplify --- stepmania/src/Course.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 89f44a3ba1..890963a6d9 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -909,24 +909,26 @@ void Course::UpdateCourseStats() unsigned i; + // courses with random/players best-worst songs should go at the end + for(i = 0; i < m_entries.size(); i++) + { + if ( m_entries[i].type == Entry::fixed ) + continue; + + SortOrder_AvgDifficulty = 9999999; // large number + if ( SortOrder_Ranking == 2 ) + SortOrder_Ranking = 3; + SortOrder_TotalDifficulty = 999999; // large number + return; + } + vector ci; GetCourseInfo( GAMESTATE->GetCurrentStyleDef()->m_NotesType, ci ); - for(i = 0; i < ci.size(); i++) - { - // courses with random/players best-worst songs should go at the end - if (m_entries[ ci[i].CourseIndex ].type != Entry::fixed) - { - SortOrder_AvgDifficulty = 9999999; // large number - if (SortOrder_Ranking == 2) SortOrder_Ranking++; - SortOrder_TotalDifficulty = 999999; // large number - return; - } + for( i = 0; i < ci.size(); i++ ) SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter(); - } SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages(); - if (GetEstimatedNumStages() > 7 && SortOrder_Ranking != 1) SortOrder_Ranking = 3; // OPTIMIZATION: Ranking info isn't dependant on style, so // call it sparingly. Its handled on startup and when