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;
}
/* 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;
// Unless the computer made a very good step, they were fooled by the mine
if( tn == TAP_MINE && score <= TNS_GOOD )
// 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();
@@ -749,6 +749,16 @@ void PlayerMinus::Step( int col, RageTimer tm )
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
* misses. */
if( score == TNS_MISS )
return;
if( IsTapAttack(tn) && score > TNS_GOOD )
{
m_soundAttackLaunch.Play();