From d10c1b08adbc28dec1fc14bf49c1ae22ce9bffcd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 31 Oct 2005 01:26:24 +0000 Subject: [PATCH] Avoid calling GetSongsValidForRandom for static courses. --- stepmania/src/Course.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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;