don't load duplicate edits

This commit is contained in:
Chris Danford
2004-04-23 01:33:08 +00:00
parent 83fb83d1b4
commit 65ea42f7b2
3 changed files with 39 additions and 10 deletions
+9 -1
View File
@@ -435,7 +435,6 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot )
Steps* pNewNotes = new Steps;
ASSERT( pNewNotes );
pSong->m_apNotes.push_back( pNewNotes );
if( iNumParams < 7 )
{
@@ -450,6 +449,15 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot )
pNewNotes->SetLoadedFromProfile( slot );
pNewNotes->SetDifficulty( DIFFICULTY_EDIT );
if( pSong->IsEditAlreadyLoaded(pNewNotes) )
{
LOG->Warn( "The edit file '%s' is a duplicate of another edit that was already loaded.", sEditFilePath.c_str() );
SAFE_DELETE( pNewNotes );
return false;
}
pSong->m_apNotes.push_back( pNewNotes );
return true; // Only allow one Steps per edit file!
}
else