diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 334a21943e..7085524c11 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -815,8 +815,8 @@ static bool CompareCoursePointersByAvgDifficulty(const Course* pCourse1, const C static bool CompareCoursePointersByTotalDifficulty(const Course* pCourse1, const Course* pCourse2) { - float iNum1 = pCourse1->SortOrder_TotalDifficulty; - float iNum2 = pCourse2->SortOrder_TotalDifficulty; + int iNum1 = pCourse1->SortOrder_TotalDifficulty; + int iNum2 = pCourse2->SortOrder_TotalDifficulty; if( iNum1 < iNum2 ) return true; @@ -828,8 +828,8 @@ static bool CompareCoursePointersByTotalDifficulty(const Course* pCourse1, const static bool CompareCoursePointersByRanking(const Course* pCourse1, const Course* pCourse2) { - float iNum1 = pCourse1->SortOrder_Ranking; - float iNum2 = pCourse2->SortOrder_Ranking; + int iNum1 = pCourse1->SortOrder_Ranking; + int iNum2 = pCourse2->SortOrder_Ranking; if( iNum1 < iNum2 ) return true; @@ -880,7 +880,6 @@ void Course::UpdateCourseStats() LOG->Trace("Updating course stats for %s", this->m_sName.c_str() ); SortOrder_AvgDifficulty = 0; - SortOrder_NumStages = 0; SortOrder_Ranking = 2; SortOrder_TotalDifficulty = 0; @@ -895,18 +894,16 @@ void Course::UpdateCourseStats() if (m_entries[i].type != Entry::fixed) { SortOrder_AvgDifficulty = 9999999; // large number - SortOrder_NumStages = ci.size(); SortOrder_Ranking = 3; SortOrder_TotalDifficulty = 999999; // large number return; } - SortOrder_NumStages++; SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter(); } - SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/SortOrder_NumStages; - if (SortOrder_NumStages > 7) SortOrder_Ranking = 3; + SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages(); + if (GetEstimatedNumStages() > 7) SortOrder_Ranking = 3; CStringArray RankingCourses; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index dbbf297d36..5656dbceab 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -121,7 +121,6 @@ public: void AddScores( NotesType nt, bool bPlayerEnabled[NUM_PLAYERS], int iDancePoints[NUM_PLAYERS], float fSurviveTime[NUM_PLAYERS], int iRankingIndexOut[NUM_PLAYERS], bool bNewRecordOut[NUM_PLAYERS] ); // iNewRecordIndexOut[p] = -1 if not a new record // sorting values - int SortOrder_NumStages; int SortOrder_TotalDifficulty; float SortOrder_AvgDifficulty; int SortOrder_Ranking;