diff --git a/src/modes/world.cpp b/src/modes/world.cpp index 47b2a13ff..cc0fc830c 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -280,7 +280,7 @@ void World::reset() race_manager->reset(); // Make sure to overwrite the data from the previous race. if(!history->replayHistory()) history->initRecording(); - if(race_manager->willRecordRace()) + if(race_manager->isRecordingRace()) { Log::info("World", "Start Recording race."); ReplayRecorder::get()->init(); @@ -436,16 +436,18 @@ World::~World() delete m_karts[i]; } - if(race_manager->hasGhostKarts()) + if(race_manager->hasGhostKarts() || race_manager->isRecordingRace()) { // Destroy the old replay object, which also stored the ghost // karts, and create a new one (which means that in further // races the usage of ghosts will still be enabled). + // It can allow auto recreation of ghost replay file lists + // when next time visit the ghost replay selection screen. ReplayPlay::destroy(); ReplayPlay::create(); } m_karts.clear(); - if(race_manager->willRecordRace()) + if(race_manager->isRecordingRace()) ReplayRecorder::get()->reset(); race_manager->setRaceGhostKarts(false); race_manager->setRecordRace(false); @@ -982,7 +984,7 @@ void World::update(float dt) PROFILER_PUSH_CPU_MARKER("World::update (sub-updates)", 0x20, 0x7F, 0x00); history->update(dt); - if(race_manager->willRecordRace()) ReplayRecorder::get()->update(dt); + if(race_manager->isRecordingRace()) ReplayRecorder::get()->update(dt); if(history->replayHistory()) dt=history->getNextDelta(); WorldStatus::update(dt); if (m_script_engine) m_script_engine->update(dt); diff --git a/src/race/race_manager.cpp b/src/race/race_manager.cpp index ae6ac8c4e..35ca51b2d 100644 --- a/src/race/race_manager.cpp +++ b/src/race/race_manager.cpp @@ -948,7 +948,7 @@ void RaceManager::setupPlayerKartInfo() void RaceManager::startWatchingReplay(const std::string &track_ident, const int num_laps) { - assert(m_watching_replay && m_has_ghost_karts && !m_will_record_race); + assert(m_watching_replay && m_has_ghost_karts && !m_is_recording_race); StateManager::get()->enterGameState(); setTrack(track_ident); setNumLaps(num_laps); diff --git a/src/race/race_manager.hpp b/src/race/race_manager.hpp index e5a564814..af5e9078b 100644 --- a/src/race/race_manager.hpp +++ b/src/race/race_manager.hpp @@ -351,7 +351,7 @@ private: /** Determines if saved GP should be continued or not*/ bool m_continue_saved_gp; - bool m_will_record_race; + bool m_is_recording_race; bool m_has_ghost_karts; @@ -722,7 +722,7 @@ public: // ------------------------------------------------------------------------ void setRecordRace(bool record) { - m_will_record_race = record; + m_is_recording_race = record; } // setRecordRace // ------------------------------------------------------------------------ void setRaceGhostKarts(bool ghost) @@ -735,10 +735,10 @@ public: m_watching_replay = watch; } // setWatchingReplay // ------------------------------------------------------------------------ - bool willRecordRace() const + bool isRecordingRace() const { - return m_will_record_race; - } // willRecordRace + return m_is_recording_race; + } // isRecordingRace // ------------------------------------------------------------------------ bool hasGhostKarts() const { diff --git a/src/states_screens/track_info_screen.cpp b/src/states_screens/track_info_screen.cpp index 0d4e02413..7ac5aa769 100644 --- a/src/states_screens/track_info_screen.cpp +++ b/src/states_screens/track_info_screen.cpp @@ -231,9 +231,9 @@ void TrackInfoScreen::init() const bool record_available = race_manager->getMinorMode() == RaceManager::MINOR_MODE_TIME_TRIAL; m_record_race->setVisible(record_available); getWidget("record-race-text")->setVisible(record_available); - if (race_manager->willRecordRace()) + if (race_manager->isRecordingRace()) { - // willRecordRace() is true when it's pre-set by ghost replay selection + // isRecordingRace() is true when it's pre-set by ghost replay selection // which force record this race m_record_this_race = true; m_record_race->setState(true);