fix "possibleDP=0 will choose Grade=Tier20, which may not have a graphic"
This commit is contained in:
@@ -412,6 +412,8 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
|||||||
m_soundInvalid.Load( THEME->GetPathToS("ScreenNameEntryTraditional invalid",true) );
|
m_soundInvalid.Load( THEME->GetPathToS("ScreenNameEntryTraditional invalid",true) );
|
||||||
|
|
||||||
SOUND->PlayMusic( THEME->GetPathToS("ScreenNameEntryTraditional music") );
|
SOUND->PlayMusic( THEME->GetPathToS("ScreenNameEntryTraditional music") );
|
||||||
|
|
||||||
|
this->SortByDrawOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int wrapn( int x, int n )
|
static inline int wrapn( int x, int n )
|
||||||
|
|||||||
@@ -181,18 +181,15 @@ Grade StageStats::GetGrade( PlayerNumber pn ) const
|
|||||||
LOG->Trace( "GetGrade: Actual: %f, Possible: %f", Actual, Possible );
|
LOG->Trace( "GetGrade: Actual: %f, Possible: %f", Actual, Possible );
|
||||||
|
|
||||||
#define ROUNDING_ERROR 0.00001f
|
#define ROUNDING_ERROR 0.00001f
|
||||||
Grade grade = (Grade)(NUM_GRADE_TIERS-1); // lowest non-failing grade
|
Grade grade;
|
||||||
|
|
||||||
if( Possible == 0 )
|
float fPercent = (Possible == 0) ? 0 : Actual / Possible;
|
||||||
return grade;
|
|
||||||
|
|
||||||
float fPercent = Actual / Possible;
|
FOREACH_Grade(g)
|
||||||
|
|
||||||
for( int g=0; g<NUM_GRADE_TIERS; g++ )
|
|
||||||
{
|
{
|
||||||
if( fPercent >= PREFSMAN->m_fGradePercent[g]-ROUNDING_ERROR )
|
if( fPercent >= PREFSMAN->m_fGradePercent[g]-ROUNDING_ERROR )
|
||||||
{
|
{
|
||||||
grade = (Grade)g;
|
grade = g;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user