fix rounding error in displaying percent score

This commit is contained in:
Chris Danford
2004-10-18 03:00:12 +00:00
parent 791fe80ef9
commit 0634c55431
4 changed files with 21 additions and 9 deletions
+1 -2
View File
@@ -197,14 +197,13 @@ Grade StageStats::GetGrade( PlayerNumber pn ) const
LOG->Trace( "GetGrade: Actual: %f, Possible: %f", Actual, Possible );
#define ROUNDING_ERROR 0.00001f
Grade grade = GRADE_FAILED;
float fPercent = (Possible == 0) ? 0 : Actual / Possible;
FOREACH_Grade(g)
{
if( fPercent >= PREFSMAN->m_fGradePercent[g]-ROUNDING_ERROR )
if( fPercent >= PREFSMAN->m_fGradePercent[g] )
{
grade = g;
break;