From a70d95db6700628f94d2c4277832315544180357 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 21 Apr 2003 20:25:20 +0000 Subject: [PATCH] fLength sometimes comes out to 0 --- stepmania/src/Song.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index a9fd140965..3b98de37e8 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1355,9 +1355,11 @@ float Song::GetDominantBPM() fLength = m_fLastBeat - m_BPMSegments[i].m_fStartBeat; else fLength = m_BPMSegments[i+1].m_fStartBeat - m_BPMSegments[i].m_fStartBeat; - ASSERT( fLength > 0 ); - fSumBPM += fBPM * fLength; - fSumWeights += fLength; + if(fLength > 0) + { + fSumBPM += fBPM * fLength; + fSumWeights += fLength; + } } return fSumBPM / fSumWeights; } \ No newline at end of file