Avoid crash if the music file does not exist.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2933 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
d0f713e03d
commit
b0dcfcb0a6
@ -934,8 +934,11 @@ void Track::getMusicInformation(std::vector<std::string>& filenames,
|
||||
} // getMusicInformation
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void Track::startMusic() const {
|
||||
sound_manager->startMusic(m_music[rand()% m_music.size()]);
|
||||
void Track::startMusic() const
|
||||
{
|
||||
// In case that the music wasn't found (a warning was already printed)
|
||||
if(m_music.size()>0)
|
||||
sound_manager->startMusic(m_music[rand()% m_music.size()]);
|
||||
} // startMusic
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user