From: Tobias Markus Date: Tue, 17 Mar 2015 16:12:22 +0000 (+0100) Subject: Fix for correct music playing after dying in a different sector X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=589f20b4fb9f3b0698ab70a748ea3b8fb129e39d;p=supertux.git Fix for correct music playing after dying in a different sector --- diff --git a/src/audio/sound_manager.hpp b/src/audio/sound_manager.hpp index 7056b0dc5..102b0a89c 100644 --- a/src/audio/sound_manager.hpp +++ b/src/audio/sound_manager.hpp @@ -74,7 +74,9 @@ public: bool is_audio_enabled() { return device != 0 && context != 0; } - + std::string get_current_music() const { + return current_music; + } void update(); /* diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index 146db5a36..351fe3123 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -1500,7 +1500,14 @@ Sector::play_music(MusicType type) void Sector::resume_music() { - SoundManager::current()->resume_music(1.5f); + if(SoundManager::current()->get_current_music() == music) + { + SoundManager::current()->resume_music(1.5f); + } + else + { + SoundManager::current()->play_music(music, true); + } } MusicType