diff --git a/src/modes/world.cpp b/src/modes/world.cpp index d3d0a3e38..339c203d7 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -471,13 +471,10 @@ void World::terminateRace() // Update highscores, and retrieve the best highscore if relevant // to show it in the GUI int best_highscore_rank = -1; - int best_finish_time = -1; std::string highscore_who = ""; - StateManager::ActivePlayer* best_player = NULL; if (!this->isNetworkWorld()) { - updateHighscores(&best_highscore_rank, &best_finish_time, &highscore_who, - &best_player); + updateHighscores(&best_highscore_rank); } // Check achievements @@ -562,8 +559,7 @@ void World::terminateRace() if (best_highscore_rank > 0) { - results->setHighscore(highscore_who, best_player, best_highscore_rank, - best_finish_time); + results->setHighscore(best_highscore_rank); } else { @@ -1037,12 +1033,9 @@ Highscores* World::getHighscores() const * score, if so it notifies the HighscoreManager so the new score is added * and saved. */ -void World::updateHighscores(int* best_highscore_rank, int* best_finish_time, - std::string* highscore_who, - StateManager::ActivePlayer** best_player) +void World::updateHighscores(int* best_highscore_rank) { *best_highscore_rank = -1; - *best_player = NULL; if(!m_use_highscores) return; @@ -1109,9 +1102,6 @@ void World::updateHighscores(int* best_highscore_rank, int* best_finish_time, highscore_rank < *best_highscore_rank) { *best_highscore_rank = highscore_rank; - *best_finish_time = (int)(k->getFinishTime()); - *best_player = controller->getPlayer(); - *highscore_who = k->getIdent(); } highscore_manager->saveHighscores(); diff --git a/src/modes/world.hpp b/src/modes/world.hpp index 1d7ed1ce6..0a76b39d3 100644 --- a/src/modes/world.hpp +++ b/src/modes/world.hpp @@ -115,9 +115,7 @@ protected: */ bool m_use_highscores; - void updateHighscores (int* best_highscore_rank, int* best_finish_time, - std::string* highscore_who, - StateManager::ActivePlayer** best_player); + void updateHighscores (int* best_highscore_rank); void resetAllKarts (); void eliminateKart (int kart_number, bool notifyOfElimination=true); Controller* diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index 9a7cffd61..01e9ace29 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -1119,22 +1119,14 @@ void RaceResultGUI::displaySoccerResults() void RaceResultGUI::clearHighscores() { - m_highscore_who = ""; - m_highscore_player = NULL; m_highscore_rank = 0; - m_highscore_time = -1; } // clearHighscores //----------------------------------------------------------------------------- -void RaceResultGUI::setHighscore(const std::string &who, - StateManager::ActivePlayer* player, int rank, - int time) +void RaceResultGUI::setHighscore(int rank) { - m_highscore_who = who; - m_highscore_player = player; m_highscore_rank = rank; - m_highscore_time = time; } // setHighscore // ---------------------------------------------------------------------------- diff --git a/src/states_screens/race_result_gui.hpp b/src/states_screens/race_result_gui.hpp index 2c2a0d0d3..ed4cb1a6a 100644 --- a/src/states_screens/race_result_gui.hpp +++ b/src/states_screens/race_result_gui.hpp @@ -170,18 +170,9 @@ private: /** Music to be played after race ended. */ MusicInformation *m_race_over_music; - /** For highscores */ - std::string m_highscore_who; - - /** For highscores */ - StateManager::ActivePlayer *m_highscore_player; - /** For highscores */ int m_highscore_rank; - /** For highscores */ - int m_highscore_time; - unsigned int m_width_all_points; int m_max_tracks; @@ -261,8 +252,7 @@ public: * \param rank Highscore rank (first highscore, second highscore, etc.). This is not the race rank * \param time Finish time in seconds */ - void setHighscore(const std::string &kart, - StateManager::ActivePlayer* player, int rank, int time); + void setHighscore(int rank); virtual void onConfirm(); }; // RaceResultGUI