From 166e8b8150b05517c4926503bd964c1b2dd39b50 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 12 Aug 2003 20:55:48 +0000 Subject: [PATCH] fix sorting for average feet difficulty --- stepmania/src/Course.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index ad28523e49..85421fbe31 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -125,6 +125,8 @@ float Course::GetMeter( int Difficult ) const else fTotalMeter += ci[c].pNotes->GetMeter(); } + + LOG->Trace("Course '%s': %f", m_sName.c_str(), fTotalMeter/ci.size() ); return fTotalMeter / ci.size(); } @@ -874,6 +876,16 @@ static bool CompareCoursePointersByAvgDifficulty(const Course* pCourse1, const C float fNum1 = pCourse1->GetMeter( false ); float fNum2 = pCourse2->GetMeter( false ); + // push non-fixed courses to end + if ( !pCourse1->IsFixed() ) + fNum1 = 1000.0f; + if ( !pCourse2->IsFixed() ) + fNum2 = 1000.0f; + + LOG->Trace("Comparison between %s (%f) and %s (%f)", + pCourse1->m_sName.c_str() , fNum1, + pCourse2->m_sName.c_str() , fNum2); + if( fNum1 < fNum2 ) return true; else if( fNum1 > fNum2 )