GetRandomSong() was returning songs in the same order every time using the internal RNG. Use g_RandomNumberGenerator instead.

This commit is contained in:
Steve Checkoway
2007-04-07 10:04:08 +00:00
parent 9d75ef8bf2
commit 00d44c63bc
+2 -2
View File
@@ -1336,10 +1336,10 @@ void SongManager::UpdateShuffled()
{ {
// update shuffled // update shuffled
m_pShuffledSongs = m_pSongs; m_pShuffledSongs = m_pSongs;
random_shuffle( m_pShuffledSongs.begin(), m_pShuffledSongs.end() ); random_shuffle( m_pShuffledSongs.begin(), m_pShuffledSongs.end(), g_RandomNumberGenerator );
m_pShuffledCourses = m_pCourses; m_pShuffledCourses = m_pCourses;
random_shuffle( m_pShuffledCourses.begin(), m_pShuffledCourses.end() ); random_shuffle( m_pShuffledCourses.begin(), m_pShuffledCourses.end(), g_RandomNumberGenerator );
} }
void SongManager::UpdatePreferredSort() void SongManager::UpdatePreferredSort()