From c4b0fb555e393fe08fcf900657243dbbd1518840 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 20 Jun 2011 14:25:57 -0400 Subject: [PATCH] Better assertion message and added comment. Yes, some BMS files crash in the default branch. I wonder if this is related to the sqlite BMS crashes I'm getting... --- src/AutoKeysounds.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 068036bd69..b536a3aa95 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -63,6 +63,10 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) if( t >= m_ndAutoKeysoundsOnly[pn].GetNumTracks() ) continue; int iNextRowForPlayer = iRow; + /* XXX: If a BMS file only has one tap note per track, + * this will prevent any keysounds from loading. + * This leads to failure later on. + * We need a better way to prevent this. */ if( m_ndAutoKeysoundsOnly[pn].GetNextTapNoteRowForTrack( t, iNextRowForPlayer ) ) iNextRow = min( iNextRow, iNextRowForPlayer ); } @@ -274,7 +278,7 @@ void AutoKeysounds::FinishLoading() delete pChain; } } - ASSERT( m_pSharedSound ); + ASSERT_M( m_pSharedSound, ssprintf("No keysounds were loaded for the song %s!", pSong->m_sMainTitle.c_str() )); m_pSharedSound = new RageSoundReader_PitchChange( m_pSharedSound ); m_pSharedSound = new RageSoundReader_PostBuffering( m_pSharedSound );