fix score updating after a player fails (amount of update is so small that it wouldn't add)

This commit is contained in:
Andrew Wong
2003-08-24 21:39:47 +00:00
parent 8e46dddfe5
commit 18f45fd799
+5 -1
View File
@@ -70,8 +70,12 @@ void ScoreDisplayNormal::Update( float fDeltaTime )
if( m_iTrailingScore != m_iScore )
{
// adjust for when player fails
int increment = int(m_iScoreVelocity * fDeltaTime);
if (m_iScoreVelocity != 0 && increment == 0) increment = 1;
int iDeltaBefore = m_iScore - m_iTrailingScore;
m_iTrailingScore += int(m_iScoreVelocity * fDeltaTime);
m_iTrailingScore += increment;
int iDeltaAfter = m_iScore - m_iTrailingScore;
if( (iDeltaBefore < 0 && iDeltaAfter > 0) ||