speed up battle music when all opponents down to 1 life.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3926 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
davemk 2009-08-27 02:00:59 +00:00
parent e06845c4af
commit 9ab21ce5fe

View File

@ -107,8 +107,17 @@ void ThreeStrikesBattle::kartHit(const int kart_id)
removeKart(kart_id);
}
// almost over, use fast music
if(getCurrentNumKarts()==2 && m_faster_music_active==false)
const unsigned int NUM_KARTS = race_manager->getNumKarts();
int num_karts_many_lives = 0;
for( unsigned int n = 0; n < NUM_KARTS; ++n )
{
if (m_kart_info[n].m_lives > 1)
num_karts_many_lives++;
}
// when almost over, use fast music
if (num_karts_many_lives<=1 && !m_faster_music_active)
{
sound_manager->switchToFastMusic();
m_faster_music_active = true;