|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:46
|
Module: performous
Branch: dance
Commit: 53b979b022c94894d7b59fe36010766c1a292ef4
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:18:21 2009 +0100
give error message for song hiscore without items
---
game/database.cc | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index cd91a9f..aa6c871 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -99,6 +99,14 @@ void Database::queryOverallHiscore (std::ostream & os, std::string const& track)
void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s, std::string const& track) const {
int songid = m_songs.lookup(s);
std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, -1, songid, track);
+
+ if (songid == -1 || hi.size() == 0)
+ {
+ os << "No Items up to now.\n";
+ os << "Be the first to be listed here!\n";
+ return;
+ }
+
for (size_t i=0; i<hi.size(); ++i)
{
os << i+1 << ".\t"
|