From 9c682d30ff0cbb7e751d4427c2c92af0f78dd439 Mon Sep 17 00:00:00 2001 From: Sean Burke Date: Sat, 12 Mar 2005 06:28:30 +0000 Subject: [PATCH] Fix a BMS-related warning --- stepmania/src/Song.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index f214b29193..82d13e45ed 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -466,14 +466,16 @@ void Song::TidyUpData() { CString error; SoundReader *Sample = SoundReader_FileReader::OpenFile( GetMusicPath(), error ); - if( Sample == NULL ) + /* XXX: Checking if the music file exists eliminates a warning originating from BMS files + * (which have no music file, per se) but it's something of a hack. */ + if( Sample == NULL && m_sMusicFile != "" ) { LOG->Warn( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() ); /* Don't use this file. */ m_sMusicFile = ""; } - else + else if ( Sample != NULL ) { m_fMusicLengthSeconds = Sample->GetLength() / 1000.0f; delete Sample;