fix not recording AAAA over AAA
This commit is contained in:
+17
-2
@@ -281,6 +281,21 @@ void Notes::SetRadarValue(int r, float val)
|
|||||||
m_fRadarValues[r] = 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 )
|
void Notes::AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut )
|
||||||
{
|
{
|
||||||
bNewRecordOut = false;
|
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[MEMORY_CARD_MACHINE].iNumTimesPlayed++;
|
||||||
m_MemCardScores[pn].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].iScore = iScore;
|
||||||
m_MemCardScores[pn].grade = grade;
|
m_MemCardScores[pn].grade = grade;
|
||||||
bNewRecordOut = true;
|
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].iScore = iScore;
|
||||||
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
int iNumTimesPlayed;
|
int iNumTimesPlayed;
|
||||||
Grade grade;
|
Grade grade;
|
||||||
int iScore;
|
int iScore;
|
||||||
|
bool HigherScore( int iScore, Grade grade ) const;
|
||||||
} m_MemCardScores[NUM_MEMORY_CARDS];
|
} m_MemCardScores[NUM_MEMORY_CARDS];
|
||||||
|
|
||||||
void AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut );
|
void AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut );
|
||||||
|
|||||||
Reference in New Issue
Block a user