do roll Step() outside of the HoldNotes logic loop (er, already did this;

simpler this way ...)
This commit is contained in:
Glenn Maynard
2005-06-16 21:41:51 +00:00
parent fb003c3189
commit 4aa9d67faf
+20 -23
View File
@@ -421,34 +421,25 @@ void Player::Update( float fDeltaTime )
// //
// handle Autoplay for rolls // handle Autoplay for rolls
// //
if( m_pPlayerState->m_PlayerController != PC_HUMAN )
{ {
const int iStartCheckingAt = max( 0, iSongRow-BeatToNoteRow(1) );
for( int iTrack=0; iTrack<m_NoteData.GetNumTracks(); ++iTrack ) for( int iTrack=0; iTrack<m_NoteData.GetNumTracks(); ++iTrack )
{ {
// Since this is being called every frame, let's not check the whole array every time. // TODO: Make the CPU miss sometimes.
// Instead, only check 1 beat back. Even 1 is overkill. int iHeadRow;
NoteData::iterator begin, end; if( !m_NoteData.IsHoldNoteAtBeat(iTrack, iSongRow, &iHeadRow) )
m_NoteData.GetTapNoteRangeInclusive( iTrack, iStartCheckingAt, iSongRow+1, begin, end ); continue;
for( ; begin != end; ++begin )
{
TapNote &tn = begin->second;
if( tn.type != TapNote::hold_head )
continue;
HoldNoteScore hns = tn.HoldResult.hns; const TapNote &tn = m_NoteData.GetTapNote( iTrack, iHeadRow );
if( hns != HNS_NONE ) // if this HoldNote already has a result if( tn.type != TapNote::hold_head || tn.subType != TapNote::hold_head_roll )
continue; // we don't need to update the logic for this one continue;
if( tn.HoldResult.hns != HNS_NONE )
continue;
if( tn.HoldResult.fLife >= 0.5f )
continue;
if( m_pPlayerState->m_PlayerController != PC_HUMAN ) RageTimer now;
{ Step( iTrack, now, false );
// TODO: Make the CPU miss sometimes.
if( tn.subType == TapNote::hold_head_roll && tn.HoldResult.fLife < 0.5f )
{
RageTimer now;
Step( iTrack, now, false );
}
}
}
} }
} }
@@ -935,6 +926,12 @@ void Player::HandleStep( int col, const RageTimer &tm, bool bHeld )
case PC_AUTOPLAY: case PC_AUTOPLAY:
score = PlayerAI::GetTapNoteScore( m_pPlayerState ); score = PlayerAI::GetTapNoteScore( m_pPlayerState );
// GetTapNoteScore always returns TNS_MARVELOUS in autoplay.
// If the step is far away, don't judge it.
if( m_pPlayerState->m_PlayerController == PC_AUTOPLAY &&
fSecondsFromPerfect > ADJUSTED_WINDOW_TAP(TW_Boo) )
score = TNS_NONE;
// TRICKY: We're asking the AI to judge mines. consider TNS_GOOD and below // 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" // as "mine was hit" and everything else as "mine was avoided"
if( tn.type == TapNote::mine ) if( tn.type == TapNote::mine )