Update iLastHeldRow even when out of range, to be sure it's clamped

properly.  Fixed hold counting glitches.
This commit is contained in:
Glenn Maynard
2005-01-18 08:20:14 +00:00
parent 9344535419
commit b0df65805e
+13 -14
View File
@@ -367,26 +367,16 @@ void Player::Update( float fDeltaTime )
float fLife = m_NoteData.GetHoldNoteLife(hn);
// If the song beat is in the range of this hold:
if( hn.RowIsInRange(iSongRow) )
{
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
// TODO: Make the CPU miss sometimes.
if( m_pPlayerState->m_PlayerController != PC_HUMAN )
bIsHoldingButton = true;
// set hold flag so NoteField can do intelligent drawing
if( m_pNoteField )
if( bSteppedOnTapNote && bIsHoldingButton )
{
m_pNoteField->m_HeldHoldNotes[hn] = bIsHoldingButton && bSteppedOnTapNote;
m_pNoteField->m_ActiveHoldNotes[hn] = bSteppedOnTapNote;
}
if( bSteppedOnTapNote )
{
/* This hold note is not judged and we stepped on its head. Update
* iLastHeldRow. */
/* This hold note is not judged and we stepped on its head. Update iLastHeldRow.
* Do this even if we're a little beyond the end of the hold note, to make sure
* iLastHeldRow is clamped to iEndRow if the hold note is held all the way. */
HoldNoteResult *hnr = NULL;
if( m_pNoteField )
@@ -399,6 +389,15 @@ void Player::Update( float fDeltaTime )
hnr->iLastHeldRow = min( iSongRow, hn.iEndRow );
}
// If the song beat is in the range of this hold:
if( hn.RowIsInRange(iSongRow) )
{
// set hold flag so NoteField can do intelligent drawing
if( m_pNoteField )
{
m_pNoteField->m_HeldHoldNotes[hn] = bIsHoldingButton && bSteppedOnTapNote;
m_pNoteField->m_ActiveHoldNotes[hn] = bSteppedOnTapNote;
}
if( bSteppedOnTapNote && bIsHoldingButton )
{