1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 09:15:33 +00:00

Merge remote-tracking branch 'ragora/playdeathlevelupmusic'

This commit is contained in:
Marc Zinnschlag 2014-09-23 13:30:50 +02:00
commit 175d4f3d44
3 changed files with 14 additions and 5 deletions

View file

@ -5,6 +5,7 @@
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/fallback.hpp"
@ -191,6 +192,9 @@ namespace MWGui
setAttributeValues();
center();
// Play LevelUp Music
MWBase::Environment::get().getSoundManager()->streamMusic("Special/MW_Triumph.mp3");
}
void LevelupDialog::onOkButtonClicked(MyGUI::Widget* sender)

View file

@ -1207,7 +1207,8 @@ namespace MWMechanics
// check if we still have any player enemies to switch music
static bool isBattleMusic = false;
if (isBattleMusic && hostilesCount == 0)
if (isBattleMusic && hostilesCount == 0 && !(player.getClass().getCreatureStats(player).isDead() &&
MWBase::Environment::get().getSoundManager()->isMusicPlaying()))
{
MWBase::Environment::get().getSoundManager()->playPlaylist(std::string("Explore"));
isBattleMusic = false;

View file

@ -1703,6 +1703,10 @@ bool CharacterController::kill()
mIdleState = CharState_None;
mCurrentIdle.clear();
// Play Death Music if it was the player dying
if(mPtr.getRefData().getHandle()=="player")
MWBase::Environment::get().getSoundManager()->streamMusic("Special/MW_Death.mp3");
return true;
}