From 848cf152c5fcb989e2a334d7045edfad083f07a8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 30 Mar 2003 20:17:00 +0000 Subject: [PATCH] fix crash when lyrics are too close together --- stepmania/src/LyricDisplay.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/LyricDisplay.cpp b/stepmania/src/LyricDisplay.cpp index 6146e12450..7072c87f89 100644 --- a/stepmania/src/LyricDisplay.cpp +++ b/stepmania/src/LyricDisplay.cpp @@ -55,6 +55,11 @@ void LyricDisplay::Update( float fDeltaTime ) const float TweenBufferTime = g_TweenInTime + g_TweenOutTime; fShowLength = min(fShowLength, Distance - TweenBufferTime); + + /* If it's negative, two lyrics are so close together that there's no time + * to tween properly. Lyrics should never be this brief, anyway, so just + * skip it. */ + fShowLength = max(fShowLength, 0); } m_textLyrics.SetText( GAMESTATE->m_pCurSong->m_LyricSegments[m_iCurLyricNumber].m_sLyric );