From 0e3375ab2d9cbe2e10bda3febd0779a158324035 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 10 Aug 2003 06:23:24 +0000 Subject: [PATCH] fix interaction between scoring and transforms that insert new notes --- stepmania/src/Player.cpp | 14 ++++++++++---- stepmania/src/ScoreKeeper.h | 2 +- stepmania/src/ScoreKeeperMAX2.cpp | 12 +++++++++--- stepmania/src/ScoreKeeperMAX2.h | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 22883f6620..dcc51dd0bf 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -696,9 +696,15 @@ void Player::HandleTapRowScore( unsigned row ) TapNoteScore scoreOfLastTap = LastTapNoteScore(row); int iNumTapsInRow = 0; - for( int c=0; c 0); @@ -714,10 +720,10 @@ void Player::HandleTapRowScore( unsigned row ) return; if(m_pPrimaryScoreKeeper) - m_pPrimaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow ); + m_pPrimaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow, iNumAdditions ); if(m_pSecondaryScoreKeeper) - m_pSecondaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow ); + m_pSecondaryScoreKeeper->HandleTapRowScore(scoreOfLastTap, iNumTapsInRow, iNumAdditions ); if (m_pScore) m_pScore->SetScore(GAMESTATE->m_CurStageStats.iScore[m_PlayerNumber]); diff --git a/stepmania/src/ScoreKeeper.h b/stepmania/src/ScoreKeeper.h index 4527127d00..3b54bfed8c 100644 --- a/stepmania/src/ScoreKeeper.h +++ b/stepmania/src/ScoreKeeper.h @@ -45,7 +45,7 @@ public: /* Note that pNoteData will include any transformations due to modifiers. */ virtual void OnNextSong( int iSongInCourseIndex, Steps* pNotes, NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course) - virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0; + virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, int iNumAdditions ) = 0; virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0; virtual int TapNoteScoreToDancePoints( TapNoteScore tns ) = 0; diff --git a/stepmania/src/ScoreKeeperMAX2.cpp b/stepmania/src/ScoreKeeperMAX2.cpp index 481ec9b391..a4785e356f 100644 --- a/stepmania/src/ScoreKeeperMAX2.cpp +++ b/stepmania/src/ScoreKeeperMAX2.cpp @@ -229,12 +229,18 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score ) GAMESTATE->m_CurStageStats.iScore[m_PlayerNumber] = m_iScore; } -void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) +void ScoreKeeperMAX2::HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, int iNumAdditions ) { ASSERT( iNumTapsInRow >= 1 ); + int iNumTapsToScore = iNumTapsInRow-iNumAdditions; - // update dance points - GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( scoreOfLastTap ); + // Update dance points. Additions don't count. + if( iNumTapsToScore > 0 ) + { + GAMESTATE->m_CurStageStats.iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( scoreOfLastTap ); + } + + // Do count additions in judge totals. GAMESTATE->m_CurStageStats.iTapNoteScores[m_PlayerNumber][scoreOfLastTap] += 1; /* diff --git a/stepmania/src/ScoreKeeperMAX2.h b/stepmania/src/ScoreKeeperMAX2.h index 508a718518..4daa4edac4 100644 --- a/stepmania/src/ScoreKeeperMAX2.h +++ b/stepmania/src/ScoreKeeperMAX2.h @@ -38,7 +38,7 @@ public: // before a song plays (called multiple times if course) void OnNextSong( int iSongInCourseIndex, Steps* pNotes, NoteData* pNoteData ); - void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ); + void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow, int iNumAdditions ); void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); int TapNoteScoreToDancePoints( TapNoteScore tns );