Bugfix: if the race menu pops up during 'ready set go', an incorrect

phase is set, resulting in the brakes of the karts not being reset.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2028 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2008-05-25 08:20:15 +00:00
parent b84cc2ae7d
commit a6439e35a5
2 changed files with 6 additions and 2 deletions

View File

@ -63,6 +63,7 @@ World::World()
delete world;
world = this;
m_phase = SETUP_PHASE;
m_previous_phase = SETUP_PHASE; // initialise it just in case
m_track = NULL;
m_clock = 0.0f;
m_faster_music_active = false;
@ -540,7 +541,7 @@ void World::updateLeaderMode(float dt)
if(m_kart[kart_number]->getPosition()==position_to_remove)
break;
}
if(kart_number==m_kart.size())
if(kart_number==(int)m_kart.size())
{
fprintf(stderr,"Problem with removing leader: position %d not found\n",
position_to_remove);
@ -716,6 +717,7 @@ void World::restartRace()
{
m_clock = 0.0f;
m_phase = SETUP_PHASE;
m_previous_phase = SETUP_PHASE;
m_faster_music_active = false;
m_eliminated_karts = 0;
m_eliminated_players = 0;
@ -775,6 +777,7 @@ Kart* World::loadRobot(const std::string& kart_name, int position,
void World::pause()
{
sound_manager -> pauseMusic() ;
m_previous_phase = m_phase;
m_phase = LIMBO_PHASE;
}
@ -782,7 +785,7 @@ void World::pause()
void World::unpause()
{
sound_manager -> resumeMusic() ;
m_phase = RACE_PHASE;
m_phase = m_previous_phase;
}
/* EOF */

View File

@ -116,6 +116,7 @@ private:
Kart* m_fastest_kart;
Highscores* m_highscores;
Phase m_phase;
Phase m_previous_phase; // used during the race popup menu
float m_clock;
float m_finish_delay_start_time;
int m_eliminated_karts; // number of eliminated karts