From 47169962e96f73222bfdb0bc2eb815a71d180bb4 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 11 Jan 2006 23:38:48 +0000 Subject: [PATCH] fix music not playing again after disable&enabling it SVN-Revision: 2986 --- src/audio/sound_manager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/audio/sound_manager.cpp b/src/audio/sound_manager.cpp index 963ce94df..1490768c9 100644 --- a/src/audio/sound_manager.cpp +++ b/src/audio/sound_manager.cpp @@ -167,12 +167,18 @@ SoundManager::stop_music(bool fade) void SoundManager::play_music(const std::string& filename, bool fade) { - if(filename == current_music) + if(filename == current_music && music_source != NULL) return; current_music = filename; if(!music_enabled) return; + if(filename == "") { + delete music_source; + music_source = 0; + return; + } + try { std::auto_ptr newmusic (new StreamSoundSource()); alSourcef(newmusic->source, AL_ROLLOFF_FACTOR, 0); -- 2.11.0