From a6439e35a5622c8bace9cfd206d94b87420069d2 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Sun, 25 May 2008 08:20:15 +0000 Subject: [PATCH] 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 --- src/world.cpp | 7 +++++-- src/world.hpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/world.cpp b/src/world.cpp index c693c438d..d3c1a4930 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -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 */ diff --git a/src/world.hpp b/src/world.hpp index ce9919315..9b87adaca 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -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