From 0994bd64bc1248739092ec7924c862c10fac1780 Mon Sep 17 00:00:00 2001 From: Thai Pangsakulyanont Date: Tue, 24 May 2011 11:12:47 +0700 Subject: [PATCH] fix crash in NotesLoaderBMS --- src/NotesLoaderBMS.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index b87a603042..3f0f2fb394 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -1183,14 +1183,17 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) Steps* pNewNotes = apSteps[i]; const bool ok = LoadFromBMSFile( out.GetSongDir() + arrayBMSFileNames[i], aBMSData[i], *pNewNotes, out, mapFilenameToKeysoundIndex ); if( ok ) + { + // set song's timing data to the main file. + if( i == iMainDataIndex ) + out.m_SongTiming = pNewNotes->m_Timing; + out.AddSteps( pNewNotes ); + } else delete pNewNotes; } - // set song's timing data to the main file. - out.m_SongTiming = apSteps[iMainDataIndex]->m_Timing; - SlideDuplicateDifficulties( out ); ConvertString( out.m_sMainTitle, "utf-8,japanese" );