diff --git a/src/modes/overworld.cpp b/src/modes/overworld.cpp index fb21e30f0..7dadbcd35 100644 --- a/src/modes/overworld.cpp +++ b/src/modes/overworld.cpp @@ -112,12 +112,11 @@ void OverWorld::update(float dt) // Skip annoying waiting without a purpose // Make sure to do all things that would normally happen in the // update() method of the base classes. - if (m_phase < GO_PHASE) + if (getPhase()< GO_PHASE) { - m_phase = GO_PHASE; - // Go message disappears at 3, music starts at 2.5 - m_auxiliary_timer = 2.0f; - // Normally done in WorldStatus::update(), SET_PHASE + setPhase(RACE_PHASE); + // Normally done in WorldStatus::update(), during phase SET_PHASE, + // so we have to start music 'manually', since we skip all phases. World::getWorld()->getTrack()->startMusic(); } LinearWorld::update(dt); diff --git a/src/modes/profile_world.cpp b/src/modes/profile_world.cpp index d263df265..4976830a1 100644 --- a/src/modes/profile_world.cpp +++ b/src/modes/profile_world.cpp @@ -43,7 +43,7 @@ ProfileWorld::ProfileWorld() // based profiling) - in case of time based profiling, the number of // laps is set to 99999. race_manager->setNumLaps(m_num_laps); - m_phase = RACE_PHASE; + setPhase(RACE_PHASE); m_frame_count = 0; m_start_time = irr_driver->getRealTime(); m_num_triangles = 0; diff --git a/src/modes/standard_race.cpp b/src/modes/standard_race.cpp index 29eca1dde..65fdb506b 100644 --- a/src/modes/standard_race.cpp +++ b/src/modes/standard_race.cpp @@ -130,6 +130,6 @@ void StandardRace::endRaceEarly() ); } // Finish the active players endSetKartPositions(); - m_phase = RESULT_DISPLAY_PHASE; + setPhase(RESULT_DISPLAY_PHASE); terminateRace(); } // endRaceEarly diff --git a/src/modes/world.cpp b/src/modes/world.cpp index 714d95f0f..0515b51aa 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -607,8 +607,8 @@ void World::updateWorld(float dt) } // Don't update world if a menu is shown or the race is over. - if( m_phase == FINISH_PHASE || - m_phase == IN_GAME_MENU_PHASE ) + if( getPhase() == FINISH_PHASE || + getPhase() == IN_GAME_MENU_PHASE ) return; update(dt); diff --git a/src/modes/world_status.hpp b/src/modes/world_status.hpp index 1216da297..cbf534011 100644 --- a/src/modes/world_status.hpp +++ b/src/modes/world_status.hpp @@ -91,7 +91,8 @@ protected: */ float m_time; ClockType m_clock_mode; - + +private: Phase m_phase; /** @@ -110,43 +111,53 @@ public: virtual ~WorldStatus(); void reset(); - - // Note: GO_PHASE is both: start phase and race phase - bool isStartPhase() const { return m_phase=GO_PHASE && - m_phase=GO_PHASE && + m_phase