Removed unused data.

This commit is contained in:
hiker 2016-01-14 08:30:02 +11:00
parent 846fd3f059
commit 45399fc43f
4 changed files with 6 additions and 36 deletions

View File

@ -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();

View File

@ -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*

View File

@ -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
// ----------------------------------------------------------------------------

View File

@ -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