Change: MUCH Cleaner fix for lifebar.
This commit is contained in:
@@ -495,14 +495,6 @@ bool LifeMeterBar::IsFailing() const
|
|||||||
|
|
||||||
void LifeMeterBar::Update( float fDeltaTime )
|
void LifeMeterBar::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
// HACK: Prevent 'Dead on Start' appearance
|
|
||||||
// the way the physics work, if there is an unusually
|
|
||||||
// larget delta, it will cause the meter to have a very
|
|
||||||
// strange effect.
|
|
||||||
//
|
|
||||||
if ( fDeltaTime >= 2.0 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
LifeMeter::Update( fDeltaTime );
|
LifeMeter::Update( fDeltaTime );
|
||||||
|
|
||||||
|
|
||||||
@@ -525,6 +517,10 @@ void LifeMeterBar::Update( float fDeltaTime )
|
|||||||
m_fTrailingLifePercentage += m_fLifeVelocity * fDeltaTime;
|
m_fTrailingLifePercentage += m_fLifeVelocity * fDeltaTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//It doesn't make sense to have a heavily negetive
|
||||||
|
//or heavily overloaded lifebar.
|
||||||
|
CLAMP( m_fTrailingLifePercentage, -0.1f, 2.0f );
|
||||||
|
|
||||||
m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2;
|
m_fPassingAlpha += IsPastPassmark() ? +fDeltaTime*2 : -fDeltaTime*2;
|
||||||
CLAMP( m_fPassingAlpha, 0, 1 );
|
CLAMP( m_fPassingAlpha, 0, 1 );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user