From 9021632dae1f46207de4718ff36993b8958fb256 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 4 Nov 2003 20:07:25 +0000 Subject: [PATCH] Don't pick up KSF "intro.wav" files as song music. --- stepmania/src/Song.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index bc385663a1..0f2a6fa363 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -597,11 +597,18 @@ void Song::TidyUpData() GetDirListing( m_sSongDir + CString("*.ogg"), arrayPossibleMusic ); GetDirListing( m_sSongDir + CString("*.wav"), arrayPossibleMusic ); - if( !arrayPossibleMusic.empty() ) // we found a match - m_sMusicFile = arrayPossibleMusic[0]; -// Don't throw on missing music. -Chris -// else -// RageException::Throw( "The song in '%s' is missing a music file. You must place a music file in the song folder or remove the song", m_sSongDir.c_str() ); + if( !arrayPossibleMusic.empty() ) + { + int idx = 0; + /* If the first song is "intro", and we have more than one available, + * don't use it--it's probably a KSF intro music file, which we don't support. */ + if( arrayPossibleMusic.size() > 1 && + !arrayPossibleMusic[0].Left(5).CompareNoCase("intro") ) + ++idx; + + // we found a match + m_sMusicFile = arrayPossibleMusic[idx]; + } } /* This must be done before radar calculation. */