fix possibleDP miscalculation when 2 players playing

This commit is contained in:
Chris Danford
2004-03-21 08:47:21 +00:00
parent d48f416ec3
commit 9b22ac2eb6
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -213,7 +213,7 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
const HighScoreList& hs = h.hs; const HighScoreList& hs = h.hs;
if( pSteps->m_StepsType == st ) if( pSteps->m_StepsType == st )
{ {
const float* fRadars = pSteps->GetRadarValues(); const RadarValues& fRadars = pSteps->GetRadarValues();
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars ); int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP ); iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
} }
@@ -237,7 +237,7 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
FOREACH_CourseDifficulty( cd ) FOREACH_CourseDifficulty( cd )
{ {
const HighScoreList& hs = h.hs[st][cd]; const HighScoreList& hs = h.hs[st][cd];
const float* fRadars = pCourse->GetRadarValues(st,cd); const RadarValues& fRadars = pCourse->GetRadarValues(st,cd);
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars ); int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP ); iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
} }
+5 -5
View File
@@ -71,11 +71,11 @@ ScoreKeeperMAX2::ScoreKeeperMAX2( const vector<Song*>& apSongs, const vector<Ste
NoteDataUtil::TransformNoteData( playerNoteDataPostModifiers, po, GAMESTATE->GetCurrentStyleDef()->m_StepsType, fStartBeat, fEndBeat ); NoteDataUtil::TransformNoteData( playerNoteDataPostModifiers, po, GAMESTATE->GetCurrentStyleDef()->m_StepsType, fStartBeat, fEndBeat );
} }
float fRadarValuesPostModifiers[NUM_RADAR_CATEGORIES]; RadarValues radarValuesPostModifiers;
FOREACH_RadarCategory( rc ) FOREACH_RadarCategory( rc )
fRadarValuesPostModifiers[rc] += NoteDataUtil::GetRadarValue( playerNoteDataPostModifiers, rc, pSong->m_fMusicLengthSeconds ); radarValuesPostModifiers[rc] += NoteDataUtil::GetRadarValue( playerNoteDataPostModifiers, rc, pSong->m_fMusicLengthSeconds );
iTotalPossibleDancePoints += this->GetPossibleDancePoints( pSteps->GetRadarValues(), fRadarValuesPostModifiers ); iTotalPossibleDancePoints += this->GetPossibleDancePoints( pSteps->GetRadarValues(), radarValuesPostModifiers );
} }
g_CurStageStats.iPossibleDancePoints[pn_] = iTotalPossibleDancePoints; g_CurStageStats.iPossibleDancePoints[pn_] = iTotalPossibleDancePoints;
@@ -429,7 +429,7 @@ void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tap
} }
int ScoreKeeperMAX2::GetPossibleDancePoints( const float* fRadars ) int ScoreKeeperMAX2::GetPossibleDancePoints( const RadarValues& fRadars )
{ {
/* Note that, if Marvelous timing is disabled or not active (not course mode), /* Note that, if Marvelous timing is disabled or not active (not course mode),
* PERFECT will be used instead. */ * PERFECT will be used instead. */
@@ -440,7 +440,7 @@ int ScoreKeeperMAX2::GetPossibleDancePoints( const float* fRadars )
NumHolds*HoldNoteScoreToDancePoints(HNS_OK); NumHolds*HoldNoteScoreToDancePoints(HNS_OK);
} }
int ScoreKeeperMAX2::GetPossibleDancePoints( const float* fOriginalRadars, const float* fPostRadars ) int ScoreKeeperMAX2::GetPossibleDancePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars )
{ {
/* /*
* The logic here is that if you use a modifier that adds notes, you should have to * The logic here is that if you use a modifier that adds notes, you should have to
+2 -2
View File
@@ -49,8 +49,8 @@ public:
// This must be calculated using only cached radar values so that we can // This must be calculated using only cached radar values so that we can
// do it quickly. // do it quickly.
static int GetPossibleDancePoints( const float* fRadars ); static int GetPossibleDancePoints( const RadarValues& fRadars );
static int GetPossibleDancePoints( const float* fOriginalRadars, const float* fPostRadars ); static int GetPossibleDancePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars );
private: private:
static int TapNoteScoreToDancePoints( TapNoteScore tns ); static int TapNoteScoreToDancePoints( TapNoteScore tns );