From c97361058a3b643fa79a2f636b14660d79d4bced Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 12 Jun 2010 23:03:55 +0000 Subject: [PATCH] Fixed empty highscore entries being written to the hgihscore file git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5507 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/race/highscores.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/race/highscores.cpp b/src/race/highscores.cpp index 83dbbbf0a..1a6ed5fe7 100644 --- a/src/race/highscores.cpp +++ b/src/race/highscores.cpp @@ -107,10 +107,14 @@ void Highscores::writeEntry(std::ofstream &writer) for(int i=0; i\n"; + if (m_time[i] > 0.0f) + { + assert(m_kart_name[i].size() > 0); + writer << " \n"; + } } // for i writer << " \n"; } // writeEntry @@ -151,6 +155,8 @@ int Highscores::addData(const std::string& kart_name, { for(int j=HIGHSCORE_LEN-2;j>=i;j--) { + assert(m_kart_name[j].size() > 0); + assert(m_time[j] > 0); m_name[j+1] = m_name[j]; m_kart_name[j+1] = m_kart_name[j]; m_time[j+1] = m_time[j];