fix "PC_CPU players rows calculate the row score more than once if mines in the row"

This commit is contained in:
Chris Danford
2004-01-11 22:29:18 +00:00
parent 6c7ac56451
commit d91d6bcb8c
+19 -9
View File
@@ -730,15 +730,15 @@ void PlayerMinus::Step( int col, RageTimer tm )
score = TNS_MISS; score = TNS_MISS;
} }
/* AI will generate misses here. Don't handle a miss like a regular note because // TRICKY: We're asking the AI to judge mines. consider TNS_GOOD and below
* we want the judgment animation to appear delayed. Instead, return early if // as "mine was hit" and everything else as "mine was avoided"
* AI generated a miss, and let UpdateMissedTapNotesOlderThan() detect and handle the if( tn == TAP_MINE )
* misses. */ {
if( score == TNS_MISS ) if( score > TNS_GOOD )
return; {
return; // avoided
// Unless the computer made a very good step, they were fooled by the mine }
if( tn == TAP_MINE && score <= TNS_GOOD ) else
{ {
score = TNS_HIT_MINE; score = TNS_HIT_MINE;
m_soundMine.Play(); m_soundMine.Play();
@@ -749,6 +749,16 @@ void PlayerMinus::Step( int col, RageTimer tm )
m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField m_pNoteField->SetTapNote(col, iIndexOverlappingNote, TAP_EMPTY); // remove from NoteField
m_pNoteField->DidTapNote( col, score, false ); 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
* misses. */
if( score == TNS_MISS )
return;
if( IsTapAttack(tn) && score > TNS_GOOD ) if( IsTapAttack(tn) && score > TNS_GOOD )
{ {
m_soundAttackLaunch.Play(); m_soundAttackLaunch.Play();