From ccbdf3a3f15d24ad65d40907b4e99f4582c7ae38 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sun, 25 Aug 2013 12:19:51 +0200 Subject: [PATCH] Prevent previous music from playing when sound file couldn't be found --- src/audio/sound_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index a7f32d864..89f86b21d 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -305,6 +305,8 @@ SoundManager::play_music(const std::string& filename, bool fade) music_source = newmusic.release(); } catch(std::exception& e) { log_warning << "Couldn't play music file '" << filename << "': " << e.what() << std::endl; + // When this happens, previous music continued playing, stop it, just in case. + stop_music(0); } } -- 2.11.0