Fix a BMS-related warning

This commit is contained in:
Sean Burke
2005-03-12 06:28:30 +00:00
parent 15486d5963
commit 9c682d30ff
+4 -2
View File
@@ -466,14 +466,16 @@ void Song::TidyUpData()
{ {
CString error; CString error;
SoundReader *Sample = SoundReader_FileReader::OpenFile( GetMusicPath(), 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() ); LOG->Warn( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() );
/* Don't use this file. */ /* Don't use this file. */
m_sMusicFile = ""; m_sMusicFile = "";
} }
else else if ( Sample != NULL )
{ {
m_fMusicLengthSeconds = Sample->GetLength() / 1000.0f; m_fMusicLengthSeconds = Sample->GetLength() / 1000.0f;
delete Sample; delete Sample;