fix hang if last BGChange is to -random-

This commit is contained in:
Chris Danford
2006-07-28 07:39:09 +00:00
parent b868d557f7
commit 6146caad68
+4 -2
View File
@@ -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;