diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 853006bddd..e4975f2df0 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -291,7 +291,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) default: ASSERT(0); } - if( GAMESTATE->IsPlayerHot(m_PlayerNumber) && score < TNS_GOOD ) + if( IsHot() && score < TNS_GOOD ) fDeltaLife = -0.10f; // make it take a while to get back to "doing great" break; case SongOptions::DRAIN_NO_RECOVER: @@ -347,7 +347,7 @@ void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) default: ASSERT(0); } - if( GAMESTATE->IsPlayerHot(m_PlayerNumber) && score == HNS_NG ) + if( IsHot() && score == HNS_NG ) fDeltaLife = -0.10f; // make it take a while to get back to "doing great" break; case SongOptions::DRAIN_NO_RECOVER: @@ -445,11 +445,11 @@ bool LifeMeterBar::IsPastPassmark() const { if( GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark > 0 ) { - return m_fLifePercentage >= GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark; + return m_fLifePercentage >= GAMESTATE->m_pPlayerState[m_PlayerNumber]->m_PlayerOptions.m_fPassmark; } else { - return false; + return false; } } @@ -476,17 +476,13 @@ void LifeMeterBar::Update( float fDeltaTime ) // HACK: Tweaking these values is very difficulty. Update the // "physics" many times so that the spring motion appears faster - - bool bIsDead = GAMESTATE->IsPlayerDead(m_PlayerNumber); - bool bIsHot = GAMESTATE->IsPlayerHot(m_PlayerNumber); - for( int i=0; i<10; i++ ) { const float fDelta = m_fLifePercentage - m_fTrailingLifePercentage; // Don't apply spring and viscous forces if we're full or empty. // Just move straight to either full or empty. - if( bIsDead || bIsHot ) + if( IsFailing() || IsHot() ) { m_fLifeVelocity = (fDelta / fabsf(fDelta)) * 4; } @@ -511,10 +507,10 @@ void LifeMeterBar::Update( float fDeltaTime ) m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2; CLAMP( m_fPassingAlpha, 0, 1 ); - m_fHotAlpha += bIsHot ? + fDeltaTime*2 : -fDeltaTime*2; + m_fHotAlpha += IsHot() ? + fDeltaTime*2 : -fDeltaTime*2; CLAMP( m_fHotAlpha, 0, 1 ); - if( bIsHot ) + if( IsHot() ) m_fLifeVelocity = max( 0, m_fLifeVelocity ); }