correctly encapsulated fast music handling for FTL
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2325 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
4a1662f0cb
commit
940f1a4702
@ -20,6 +20,7 @@
|
|||||||
#include "gui/menu_manager.hpp"
|
#include "gui/menu_manager.hpp"
|
||||||
#include "user_config.hpp"
|
#include "user_config.hpp"
|
||||||
#include "translation.hpp"
|
#include "translation.hpp"
|
||||||
|
#include "audio/sound_manager.hpp"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
FollowTheLeaderRace::FollowTheLeaderRace() : LinearWorld()
|
FollowTheLeaderRace::FollowTheLeaderRace() : LinearWorld()
|
||||||
@ -70,6 +71,11 @@ void FollowTheLeaderRace::countdownReachedZero()
|
|||||||
{
|
{
|
||||||
removeKart(kart_number);
|
removeKart(kart_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// almost over, use fast music
|
||||||
|
if(getCurrentNumKarts()==3)
|
||||||
|
sound_manager->switchToFastMusic();
|
||||||
|
|
||||||
// The follow the leader race is over if there is only one kart left,
|
// The follow the leader race is over if there is only one kart left,
|
||||||
// or if all players have gone
|
// or if all players have gone
|
||||||
if(getCurrentNumKarts()==2 || getCurrentNumPlayers()==0)
|
if(getCurrentNumKarts()==2 || getCurrentNumPlayers()==0)
|
||||||
|
@ -290,13 +290,6 @@ void LinearWorld::doLapCounting ( KartInfo& kart_info, Kart* kart )
|
|||||||
// Prevent cheating by setting time to a negative number, indicating
|
// Prevent cheating by setting time to a negative number, indicating
|
||||||
// that the line wasn't crossed properly.
|
// that the line wasn't crossed properly.
|
||||||
kart_info.m_lap_start_time = -1.0f;
|
kart_info.m_lap_start_time = -1.0f;
|
||||||
} else
|
|
||||||
{ // Switch to fast music in case of follow the leader when only 3 karts are left
|
|
||||||
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_FOLLOW_LEADER &&
|
|
||||||
RaceManager::getWorld()->getCurrentNumKarts()==3)
|
|
||||||
{
|
|
||||||
sound_manager->switchToFastMusic();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // doLapCounting
|
} // doLapCounting
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user