diff --git a/src/audio/music_manager.hpp b/src/audio/music_manager.hpp index 0c0e908c1..66ffbac66 100644 --- a/src/audio/music_manager.hpp +++ b/src/audio/music_manager.hpp @@ -78,6 +78,7 @@ public: void loadMusicFromOneDir(const std::string& dir); void addMusicToTracks(); + void clearCurrentMusic() { m_current_music = NULL; } }; extern MusicManager* music_manager; diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 5bde4aec1..1154d041c 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -390,6 +390,8 @@ void Track::startMusic() const // In case that the music wasn't found (a warning was already printed) if(m_music.size()>0) music_manager->startMusic(m_music[rand()% m_music.size()], false); + else + music_manager->clearCurrentMusic(); } // startMusic //-----------------------------------------------------------------------------