fix not recording AAAA over AAA

This commit is contained in:
Glenn Maynard
2003-07-28 18:23:16 +00:00
parent c893c9aca8
commit db56b757f5
2 changed files with 18 additions and 2 deletions
+17 -2
View File
@@ -281,6 +281,21 @@ void Notes::SetRadarValue(int r, float val)
m_fRadarValues[r] = val;
}
/* Make sure we treat AAAA as higher than AAA, even though the score
* is the same.
*
* XXX: Isn't it possible to beat the grade but not beat the score, since
* grading and scores are on completely different systems? Should we be
* checking for these completely separately? */
bool Notes::MemCardScore::HigherScore( int vsScore, Grade vsGrade ) const
{
if( vsScore > this->iScore )
return true;
if( vsScore < this->iScore )
return false;
return vsGrade > this->grade;
}
void Notes::AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut )
{
bNewRecordOut = false;
@@ -288,14 +303,14 @@ void Notes::AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecord
m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed++;
m_MemCardScores[pn].iNumTimesPlayed++;
if( iScore > m_MemCardScores[pn].iScore )
if( m_MemCardScores[pn].HigherScore(iScore, grade) )
{
m_MemCardScores[pn].iScore = iScore;
m_MemCardScores[pn].grade = grade;
bNewRecordOut = true;
}
if( iScore > m_MemCardScores[MEMORY_CARD_MACHINE].iScore )
if( m_MemCardScores[MEMORY_CARD_MACHINE].HigherScore(iScore, grade) )
{
m_MemCardScores[MEMORY_CARD_MACHINE].iScore = iScore;
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
+1
View File
@@ -58,6 +58,7 @@ public:
int iNumTimesPlayed;
Grade grade;
int iScore;
bool HigherScore( int iScore, Grade grade ) const;
} m_MemCardScores[NUM_MEMORY_CARDS];
void AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut );