X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsupertux%2Fgame_session.cpp;fp=src%2Fsupertux%2Fgame_session.cpp;h=da864e27bcfde50f76f4ded6df94bd8cb0454146;hb=8e52a5b000d732e96b1cc461163c4778b434dc27;hp=57e48e455a69e4c520ca999dd40140dfd23fb217;hpb=96b4e53a6448ab88c1897d6552a8ac09cc2fbeae;p=supertux.git diff --git a/src/supertux/game_session.cpp b/src/supertux/game_session.cpp index 57e48e455..da864e27b 100644 --- a/src/supertux/game_session.cpp +++ b/src/supertux/game_session.cpp @@ -82,7 +82,7 @@ GameSession::GameSession(const std::string& levelfile_, Savegame& savegame, Stat } int -GameSession::restart_level() +GameSession::restart_level(bool after_death) { PlayerStatus* currentStatus = m_savegame.get_player_status(); coins_at_start = currentStatus->coins; @@ -130,9 +130,13 @@ GameSession::restart_level() ScreenManager::current()->pop_screen(); return (-1); } - - SoundManager::current()->stop_music(); - currentsector->play_music(LEVEL_MUSIC); + if(after_death == true) { + currentsector->resume_music(); + } + else { + SoundManager::current()->stop_music(); + currentsector->play_music(LEVEL_MUSIC); + } if(capture_file != "") { int newSeed=0; // next run uses a new seed @@ -371,7 +375,7 @@ GameSession::check_end_conditions() if(end_sequence && end_sequence->is_done()) { finish(true); } else if (!end_sequence && tux->is_dead()) { - restart_level(); + restart_level(true); } }