From e90ab78c63ddfe4c5fafff689aa9b6c9c00744c0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 7 Sep 2003 03:54:21 +0000 Subject: [PATCH] Don't use RemoveNotes in DeleteDuplicateSteps. --- stepmania/src/Song.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 14ff46597b..15d0b9c5fb 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -490,6 +490,7 @@ static void GetImageDirListing( CString sPath, CStringArray &AddTo, bool bReturn GetDirListing( sPath + ".gif", AddTo, false, bReturnPathToo ); } +/* This is called within TidyUpData, before autogen notes are added. */ static void DeleteDuplicateSteps( Song *song, vector &vSteps ) { CHECKPOINT; @@ -514,7 +515,19 @@ static void DeleteDuplicateSteps( Song *song, vector &vSteps ) song->GetSongDir().c_str(), s1->GetDescription().c_str(), s1->GetMeter() ); CHECKPOINT; - song->RemoveNotes(s2); + + /* Don't use RemoveNotes; autogen notes havn't yet been created and it'll + * create them. */ + for( int k=song->m_apNotes.size()-1; k>=0; k-- ) + { + if( song->m_apNotes[k] == s2 ) + { + delete song->m_apNotes[k]; + song->m_apNotes.erase( song->m_apNotes.begin()+k ); + break; + } + } + CHECKPOINT; vSteps.erase(vSteps.begin()+j); CHECKPOINT;