fix reverting in the editor goes to the wrong song if the selected song

has a blank description
This commit is contained in:
Glenn Maynard
2004-04-24 21:01:32 +00:00
parent 4bdf480a6f
commit dffe8cf029
+5 -2
View File
@@ -150,11 +150,14 @@ void StepsID::FromSteps( const Steps *p )
* to have access to Song::m_LoadedFromProfile. */ * to have access to Song::m_LoadedFromProfile. */
Steps *StepsID::ToSteps( const Song *p, bool bAllowNull ) const Steps *StepsID::ToSteps( const Song *p, bool bAllowNull ) const
{ {
if( st == STEPS_TYPE_INVALID || dc == DIFFICULTY_INVALID || sDescription.empty() ) if( st == STEPS_TYPE_INVALID || dc == DIFFICULTY_INVALID )
return NULL; return NULL;
vector<Steps*> vNotes; vector<Steps*> vNotes;
p->GetSteps( vNotes, st, dc, -1, -1, sDescription, true ); if( dc == DIFFICULTY_EDIT )
p->GetSteps( vNotes, st, dc, -1, -1, sDescription, true );
else
p->GetSteps( vNotes, st, dc, -1, -1, "", true );
if( !vNotes.empty() ) if( !vNotes.empty() )
return vNotes[0]; return vNotes[0];
if( bAllowNull ) if( bAllowNull )