From 9ab21ce5fe1100c236dc4eacaea455a8ca08fe4f Mon Sep 17 00:00:00 2001 From: davemk Date: Thu, 27 Aug 2009 02:00:59 +0000 Subject: [PATCH] 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 --- src/modes/three_strikes_battle.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/modes/three_strikes_battle.cpp b/src/modes/three_strikes_battle.cpp index 92d9b697c..d0ed29f14 100644 --- a/src/modes/three_strikes_battle.cpp +++ b/src/modes/three_strikes_battle.cpp @@ -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;