From d91d6bcb8caa473b8df5cb0fa756d87c5ee12328 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 11 Jan 2004 22:29:18 +0000 Subject: [PATCH] fix "PC_CPU players rows calculate the row score more than once if mines in the row" --- stepmania/src/Player.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 2fdb94b8ff..8c13d33da7 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -730,6 +730,27 @@ void PlayerMinus::Step( int col, RageTimer tm ) score = TNS_MISS; } + // TRICKY: We're asking the AI to judge mines. consider TNS_GOOD and below + // as "mine was hit" and everything else as "mine was avoided" + if( tn == TAP_MINE ) + { + if( score > TNS_GOOD ) + { + return; // avoided + } + else + { + score = TNS_HIT_MINE; + m_soundMine.Play(); + if( m_pLifeMeter ) + m_pLifeMeter->ChangeLifeMine(); + if( m_pCombinedLifeMeter ) + m_pCombinedLifeMeter->ChangeLifeMine(m_PlayerNumber); + m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField + m_pNoteField->DidTapNote( col, score, false ); + } + } + /* AI will generate misses here. Don't handle a miss like a regular note because * we want the judgment animation to appear delayed. Instead, return early if * AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the @@ -737,18 +758,7 @@ void PlayerMinus::Step( int col, RageTimer tm ) if( score == TNS_MISS ) return; - // Unless the computer made a very good step, they were fooled by the mine - if( tn == TAP_MINE && score <= TNS_GOOD ) - { - score = TNS_HIT_MINE; - m_soundMine.Play(); - if( m_pLifeMeter ) - m_pLifeMeter->ChangeLifeMine(); - if( m_pCombinedLifeMeter ) - m_pCombinedLifeMeter->ChangeLifeMine(m_PlayerNumber); - m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField - m_pNoteField->DidTapNote( col, score, false ); - } + if( IsTapAttack(tn) && score > TNS_GOOD ) { m_soundAttackLaunch.Play();