Don't list difficulties that don't exist in "Fill Steps" (ROW_SOURCE_STEPS_TYPE).

This commit is contained in:
Glenn Maynard
2006-03-29 07:56:39 +00:00
parent 7812a4ba47
commit d939a15876
+2 -3
View File
@@ -515,7 +515,8 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
if( dc != DIFFICULTY_EDIT ) if( dc != DIFFICULTY_EDIT )
{ {
Steps *pSteps = GetSelectedSong()->GetStepsByDifficulty( GetSelectedSourceStepsType(), dc ); Steps *pSteps = GetSelectedSong()->GetStepsByDifficulty( GetSelectedSourceStepsType(), dc );
m_vpSourceSteps.push_back( StepsAndDifficulty(pSteps,dc) ); if( pSteps != NULL )
m_vpSourceSteps.push_back( StepsAndDifficulty(pSteps,dc) );
} }
else else
{ {
@@ -524,8 +525,6 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
StepsUtil::SortStepsByDescription( v ); StepsUtil::SortStepsByDescription( v );
FOREACH_CONST( Steps*, v, pSteps ) FOREACH_CONST( Steps*, v, pSteps )
m_vpSourceSteps.push_back( StepsAndDifficulty(*pSteps,dc) ); m_vpSourceSteps.push_back( StepsAndDifficulty(*pSteps,dc) );
if( v.empty() )
m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,dc) );
} }
} }
CLAMP( m_iSelection[ROW_SOURCE_STEPS], 0, m_vpSourceSteps.size()-1 ); CLAMP( m_iSelection[ROW_SOURCE_STEPS], 0, m_vpSourceSteps.size()-1 );