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,7 +934,10 @@ void Track::getMusicInformation(std::vector<std::string>& filenames,
|
|||||||
} // getMusicInformation
|
} // getMusicInformation
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void Track::startMusic() const {
|
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()]);
|
sound_manager->startMusic(m_music[rand()% m_music.size()]);
|
||||||
} // startMusic
|
} // startMusic
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user