From 39594104605034e37cbe22031d842ba14b211b6e Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Thu, 3 Jun 2010 12:52:02 -0500 Subject: [PATCH] If AutoSetStyle is on and Autogen is off, some songs with valid steps may be missing from the wheel. Re-add them by checking for every playable StepsType when AutoSetStyle is on. fixes issue 147: http://ssc.ajworld.net/sm-ssc/bugtracker/view.php?id=147 --- src/MusicWheel.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index fd6d90a78e..b85b437273 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -380,9 +380,33 @@ void MusicWheel::GetSongList( vector &arraySongs, SortOrder so ) } else { - // If the song has at least one steps, add it. - if( pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) ) - arraySongs.push_back( pSong ); + if(CommonMetrics::AUTO_SET_STYLE) + { + // with AUTO_SET_STYLE on and Autogen off, some songs may get + // hidden. Search through every playable StepsType until you + // find one, then add the song. + // see Issue 147 for more information. -aj + // http://ssc.ajworld.net/sm-ssc/bugtracker/view.php?id=147 + set vStepsType; + SongUtil::GetPlayableStepsTypes( pSong, vStepsType ); + bool bHasFoundStepsType = false; + + FOREACHS( StepsType, vStepsType, st ) + { + if(pSong->HasStepsType(*st) && !bHasFoundStepsType) + { + arraySongs.push_back( pSong ); + bHasFoundStepsType = true; + continue; + } + } + } + else + { + // If the song has at least one steps, add it. + if( pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) ) + arraySongs.push_back( pSong ); + } } }