fix wrong grade calculation when using mods

This commit is contained in:
Chris Danford
2005-04-26 08:14:46 +00:00
parent 0ec148b4f0
commit 2e55c56596
+2 -9
View File
@@ -130,13 +130,6 @@ Grade PlayerStageStats::GetGrade() const
/* XXX: This entire calculation should be in ScoreKeeper, but final evaluation /* XXX: This entire calculation should be in ScoreKeeper, but final evaluation
* is tricky since at that point the ScoreKeepers no longer exist. */ * is tricky since at that point the ScoreKeepers no longer exist. */
float fPossible = 0;
FOREACH_CONST( Steps*, vpPossibleSteps, s )
{
fPossible += (*s)->GetRadarValues().m_Values.v.fNumTapsAndHolds * PREFSMAN->m_iGradeWeightMarvelous;
fPossible += (*s)->GetRadarValues().m_Values.v.fNumHolds * PREFSMAN->m_iGradeWeightOK;
}
float fActual = 0; float fActual = 0;
FOREACH_TapNoteScore( tns ) FOREACH_TapNoteScore( tns )
{ {
@@ -170,10 +163,10 @@ Grade PlayerStageStats::GetGrade() const
fActual += iHoldNoteScores[hns] * iHoldScoreValue; fActual += iHoldNoteScores[hns] * iHoldScoreValue;
} }
LOG->Trace( "GetGrade: fActual: %f, fPossible: %f", fActual, fPossible ); LOG->Trace( "GetGrade: fActual: %f, fPossible: %d", fActual, iPossibleDancePoints );
float fPercent = (fPossible == 0) ? 0 : fActual / fPossible; float fPercent = (iPossibleDancePoints == 0) ? 0 : fActual / iPossibleDancePoints;
Grade grade = GetGradeFromPercent( fPercent ); Grade grade = GetGradeFromPercent( fPercent );