From 7553cf3afae90e149e9677e60272a2abb0ed42d1 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Wed, 30 Jul 2003 10:04:59 +0000 Subject: [PATCH] oops, account for bug if user uses regular songs with caprice songs --- 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 99a65d8c87..0da87ff875 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -502,7 +502,6 @@ void Course::GetCourseInfo( NotesType nt, vector &ci, int Difficul if( pNotes ) // found a match { LOG->Trace("Accessing caprice at %d", pSong); - m_CapriceEntries.push_back(pSong); // cache it for later LOG->Trace("Song title: %s", pSong->GetFullTranslitTitle().c_str() ); break; // stop searching } @@ -583,6 +582,14 @@ void Course::GetCourseInfo( NotesType nt, vector &ci, int Difficul if( !pSong || !pNotes ) continue; // this song entry isn't playable. Skip. + m_CapriceEntries.push_back(pSong); // cache it for random caprice + // NOTE: it must be done for all songs because + // above it searches the entire array; for example + // if a song is defined for songs 1 and 2 and caprice + // is 3, it'll only have pushed one song if it was in + // the old location. Thus, here it'll make sure + // the indice exists. + /* If e.difficulty == DIFFICULTY_INVALID, then we already increased difficulty * based on meter. */ if( IsDifficult(Difficult) && e.difficulty != DIFFICULTY_INVALID )