diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index e01ef01b9e..ca42895de8 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -563,7 +563,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) bool bCourseDifficultyIsSignificant = (cd == DIFFICULTY_MEDIUM); vector vpAllPossibleSongs; - GetSongsValidForRandom( vpAllPossibleSongs ); + bool bHaveAllSongs = false; // true if vpAllPossibleSongs has been generated // Resolve each entry to a Song and Steps. FOREACH_CONST( CourseEntry, entries, e ) @@ -589,6 +589,13 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) } else { + /* Generate vpAllPossibleSongs, if we havn't yet. */ + if( !bHaveAllSongs ) + { + GetSongsValidForRandom( vpAllPossibleSongs ); + bHaveAllSongs = true; + } + // copy over any songs that match our group filter, if one is set, and match our // steps filter. vector vpPossibleSongs;