diff --git a/source/game/bosstext.cpp b/source/game/bosstext.cpp index 25bbc96eb..2b90f84b2 100644 --- a/source/game/bosstext.cpp +++ b/source/game/bosstext.cpp @@ -133,13 +133,16 @@ void CBossText::shutdown() Params: Returns: ---------------------------------------------------------------------- */ -void CBossText::select() +void CBossText::select(int _dontChangeMusic) { m_readyToExit=false; m_currentPage=0; - CSoundMediator::stopSong(); - CSoundMediator::setSong(s_bossData[GameScene.GetLevel().getCurrentChapter()-1].m_songId); + if(!_dontChangeMusic) + { + CSoundMediator::stopSong(); + CSoundMediator::setSong(s_bossData[GameScene.GetLevel().getCurrentChapter()-1].m_songId); + } } /*---------------------------------------------------------------------- diff --git a/source/game/bosstext.h b/source/game/bosstext.h index 15a718ec9..4b1821b04 100644 --- a/source/game/bosstext.h +++ b/source/game/bosstext.h @@ -40,7 +40,7 @@ public: void init(); void shutdown(); - void select(); + void select(int _dontChangeMusic=false); void think(int _frames); void render(); int isReadyToExit(); diff --git a/source/game/game.cpp b/source/game/game.cpp index 3bb8032bd..816a37d6b 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -226,6 +226,7 @@ void CGameScene::init() m_showingLivesTimer=0; s_showBossTextOnRespawn=false; + m_playingBossMusic=false; } /*****************************************************************************/ // This is a seperate funtion ( and virtual ) so that we can overload it for @@ -419,7 +420,11 @@ void CGameScene::think(int _frames) if(m_bossText->isReadyToExit()) { m_gamestate=GAMESTATE_PLAYING; - CSoundMediator::playSong(); + if(!m_playingBossMusic) + { + CSoundMediator::playSong(); + m_playingBossMusic=true; + } sendEvent( BOSS_FOUND_EVENT, NULL ); CFader::setFadingIn(); } @@ -739,7 +744,7 @@ void CGameScene::respawnLevel() else { m_gamestate=GAMESTATE_SHOWING_LIVES_BUT_GOING_TO_BOSS_TEXT; - m_bossText->select(); + m_bossText->select(m_playingBossMusic); } m_showingLivesTimer=0; CSoundMediator::setCanPlaySfx(true); diff --git a/source/game/game.h b/source/game/game.h index b97692c15..aed6a1830 100644 --- a/source/game/game.h +++ b/source/game/game.h @@ -139,6 +139,7 @@ static CLayerCollision *s_GlobalCollision; static int s_bossHasBeenKilled; static DVECTOR s_CamShake; static int s_showBossTextOnRespawn; + int m_playingBossMusic; int m_levelHasTimer;