Player: remove fake loop, simplify hopo logic

This commit is contained in:
Devin J. Pohly
2013-01-25 18:18:13 -05:00
parent 0b32d2bf9a
commit 1a150b96d5
+4 -16
View File
@@ -2436,22 +2436,18 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
} }
break; break;
case ButtonType_Hopo: case ButtonType_Hopo:
{
bool bDidHopo = true;
for (;;)
{ {
// only can hopo on a row with one note // only can hopo on a row with one note
if( m_NoteData.GetNumTapNotesInRow(iRowOfOverlappingNoteOrRow) != 1 ) if( m_NoteData.GetNumTapNotesInRow(iRowOfOverlappingNoteOrRow) != 1 )
{ {
bDidHopo = false; score = TNS_None;
break; break;
} }
// con't hopo on the same note 2x in a row // con't hopo on the same note 2x in a row
if( col == m_pPlayerState->m_iLastHopoNoteCol ) if( col == m_pPlayerState->m_iLastHopoNoteCol )
{ {
bDidHopo = false; score = TNS_None;
break; break;
} }
@@ -2463,28 +2459,20 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
ASSERT( !iter.IsAtEnd() ); // there must have been a note that started the hopo ASSERT( !iter.IsAtEnd() ); // there must have been a note that started the hopo
if( !NoteDataWithScoring::IsRowCompletelyJudged(m_NoteData, iter.Row()) ) if( !NoteDataWithScoring::IsRowCompletelyJudged(m_NoteData, iter.Row()) )
{ {
bDidHopo = false; score = TNS_None;
break; break;
} }
const TapNoteResult &lastTNR = NoteDataWithScoring::LastTapNoteWithResult( m_NoteData, iter.Row() ).result; const TapNoteResult &lastTNR = NoteDataWithScoring::LastTapNoteWithResult( m_NoteData, iter.Row() ).result;
if( lastTNR.tns <= TNS_Miss ) if( lastTNR.tns <= TNS_Miss )
{ {
bDidHopo = false; score = TNS_None;
}
break; break;
} }
if( !bDidHopo )
{
score = TNS_None;
}
else
{
m_pPlayerState->m_fLastHopoNoteMusicSeconds = fStepSeconds; m_pPlayerState->m_fLastHopoNoteMusicSeconds = fStepSeconds;
m_pPlayerState->m_iLastHopoNoteCol = col; m_pPlayerState->m_iLastHopoNoteCol = col;
} }
}
break; break;
case ButtonType_Step: case ButtonType_Step:
break; break;