diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index d90a368591..4a95e85d57 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -1031,7 +1031,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) // Create a Steps for each. vector apSteps; for( unsigned i=0; i &Bla 0==stricmp(sValueName,"COUPLE") || 0==stricmp(sValueName,"SOLO") ) { - Steps* pNewNotes = new Steps; + Steps* pNewNotes = out.CreateSteps(); LoadFromDWITokens( sParams[0], sParams[1], diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 6de736cabe..a74b3610a8 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -877,7 +877,7 @@ skip_track: } } - Steps *pSteps = new Steps; + Steps *pSteps = songOut.CreateSteps(); pSteps->m_StepsType = StepsType_guitar_five; pSteps->SetDifficulty( (Difficulty)(gd+1) ); pSteps->SetNoteData( noteData ); diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index 08f8efbb79..b733aa3d9f 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -843,7 +843,7 @@ bool PMSLoader::LoadFromDir( const RString &sDir, Song &out ) /* Create a Steps for each. */ vector apSteps; for( unsigned i=0; iCreateSteps(); LoadFromSMTokens( sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], *pNewNotes); diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index dd6ce2c60f..93dcb65095 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -360,7 +360,7 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out ) continue; } - Steps* pNewNotes = new Steps; + Steps* pNewNotes = out.CreateSteps(); LoadFromSMATokens( sParams[1], sParams[2], @@ -702,7 +702,7 @@ bool SMALoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat if( !bAddStepsToSong ) return true; - Steps* pNewNotes = new Steps; + Steps* pNewNotes = pSong->CreateSteps(); LoadFromSMATokens( sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], *pNewNotes); diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index a2308e9fd2..59483ee25f 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -686,7 +686,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="NOTEDATA" ) { state = GETTING_STEP_INFO; - pNewNotes = new Steps; + pNewNotes = out.CreateSteps(); } break; } @@ -957,7 +957,7 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat else if( sValueName=="NOTEDATA" ) { - pNewNotes = new Steps; + pNewNotes = pSong->CreateSteps(); bSSCFormat = true; } if( sValueName=="STEPSTYPE" ) @@ -1062,7 +1062,7 @@ bool SSCLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePat } else { - pNewNotes = new Steps; + pNewNotes = pSong->CreateSteps(); SMLoader::LoadFromSMTokens( sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], *pNewNotes); diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 52e9c62ea0..49b057da6d 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -3953,7 +3953,7 @@ void ScreenEdit::RevertFromDisk() // put a blank Steps in its place. Note that this does not have to be the // work of someone maliciously changing the simfile; it could happen to // someone editing a new stepchart and reverting from disk, for example. - pNewSteps = new Steps(); + pNewSteps = GAMESTATE->m_pCurSong->CreateSteps(); pNewSteps->CreateBlank( id.GetStepsType() ); pNewSteps->SetDifficulty( id.GetDifficulty() ); GAMESTATE->m_pCurSong->AddSteps( pNewSteps );