From 4f5febbf07a3ef9ef37100fd3b86200738805042 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 4 Jun 2004 02:52:07 +0000 Subject: [PATCH] fix m_iCustomMeter not initialized correctly GetTrails: don't return course difficulties that aren't being displayed --- stepmania/src/Course.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 81f56580f1..2cefcf24a2 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -263,7 +263,8 @@ void Course::Init() m_bRandomize = false; m_iLives = -1; m_bSortByMeter = false; - ZERO( m_iCustomMeter ); + FOREACH_Difficulty(dc) + m_iCustomMeter[dc] = -1; m_entries.clear(); m_sPath = m_sName = m_sNameTranslit = m_sBannerPath = m_sCDTitlePath = ""; ZERO( m_TrailCacheValid ); @@ -381,7 +382,8 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, Difficulty diff ) m_bRepeat = true; m_bRandomize = true; m_iLives = -1; - m_iCustomMeter[0] = m_iCustomMeter[1] = -1; + FOREACH_Difficulty(dc) + m_iCustomMeter[dc] = -1; if( sGroupName == "" ) { @@ -434,7 +436,8 @@ void Course::AutogenOniFromArtist( CString sArtistName, CString sArtistNameTrans m_bSortByMeter = true; m_iLives = 4; - m_iCustomMeter[0] = m_iCustomMeter[1] = -1; + FOREACH_Difficulty(cd) + m_iCustomMeter[cd] = -1; ASSERT( sArtistName != "" ); ASSERT( aSongs.size() > 0 ); @@ -823,7 +826,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) void Course::GetTrails( vector &AddTo, StepsType st ) const { - FOREACH_CourseDifficulty( cd ) + FOREACH_ShownCourseDifficulty( cd ) { Trail *pTrail = GetTrail( st, cd ); if( pTrail == NULL )