From fff14492397f921c935a7b49710a1af91e1ae4cd Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 Feb 2003 00:58:04 +0000 Subject: [PATCH] Add an entry per song for endless courses, to reduce repetition. Improve IsPlayableIn. --- stepmania/src/Course.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 84f9387e05..bd7f3ade6d 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -267,11 +267,18 @@ void Course::AutoGenEndlessFromGroupAndDifficulty( CString sGroupName, Difficult } // only need one song because it repeats + // We want multiple songs, so we can try to prevent repeats during + // gameplay. (We might still get a repeat at the repeat boundary, + // but that'd be rare.) -glenn Entry e; e.type = Entry::random_within_group; e.group_name = sGroupName; e.difficulty = dc; - m_entries.push_back( e ); + + vector vSongs; + SONGMAN->GetSongs( vSongs, e.group_name ); + for( unsigned i = 0; i < vSongs.size(); ++i) + m_entries.push_back( e ); } @@ -285,8 +292,15 @@ bool Course::HasDifficult() const bool Course::IsPlayableIn( NotesType nt ) const { - // TODO: something smarter here - return m_entries.size() > 0; + /* XXX: Is this good enough? This needs to be guaranteed: if we say + * a course is playable and it's not, we'll crash in ScreenGameplay. */ + + vector vSongs; + vector vNotes; + vector vsModifiers; + GetStageInfo( vSongs, vNotes, vsModifiers, nt, false); + + return vNotes.size() > 0; }