From 6146caad6864ba7c132c7c43d4b2f4fdcc7c43ce Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 28 Jul 2006 07:39:09 +0000 Subject: [PATCH] fix hang if last BGChange is to -random- --- stepmania/src/Background.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 8da0932c21..b391e44a1f 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -660,8 +660,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) if( change.m_def.m_sFile1 != RANDOM_BACKGROUND_FILE ) continue; - const float fStartBeat = change.m_fStartBeat; - const float fEndBeat = (i+1 < mainlayer.m_aBGChanges.size())? mainlayer.m_aBGChanges[i+1].m_fStartBeat: FLT_MAX; + float fStartBeat = change.m_fStartBeat; + float fEndBeat = pSong->m_fLastBeat; + if( i+1 < mainlayer.m_aBGChanges.size() ) + fEndBeat = mainlayer.m_aBGChanges[i+1].m_fStartBeat; mainlayer.m_aBGChanges.erase( mainlayer.m_aBGChanges.begin()+i ); --i;