Don't add random entries (pSong = NULL) to vSongs. Assert that pSong is never NULL.
This commit is contained in:
@@ -37,7 +37,8 @@ void ScreenJukebox::SetSong()
|
||||
Course *pCourse = SONGMAN->GetCourseFromName( THEME->GetCurThemeName() );
|
||||
if( pCourse != NULL )
|
||||
for ( unsigned i = 0; i < pCourse->m_vEntries.size(); i++ )
|
||||
vSongs.push_back( pCourse->m_vEntries[i].pSong );
|
||||
if( pCourse->m_vEntries[i].IsFixedSong() )
|
||||
vSongs.push_back( pCourse->m_vEntries[i].pSong );
|
||||
|
||||
if ( vSongs.size() == 0 )
|
||||
SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredSongGroup );
|
||||
@@ -78,6 +79,7 @@ void ScreenJukebox::SetSong()
|
||||
|
||||
Song* pSong = vSongs[RandomInt(vSongs.size())];
|
||||
|
||||
ASSERT( pSong != NULL );
|
||||
if( !pSong->HasMusic() )
|
||||
continue; // skip
|
||||
if( UNLOCKMAN->SongIsLocked(pSong) )
|
||||
|
||||
Reference in New Issue
Block a user