summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-11-11 20:21:29 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-11-11 20:21:29 +0100
commit366b880a8dd4429ab623a34e60e1bce9e6e68c43 (patch)
tree539a320b96a4d31dc0133c252bdf06d35b02d1a3 /data
parentaed54060e92be8af11f7f58bddeffb5e2c997e27 (diff)
UNO plugin: handle empty top lists
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/games/uno.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb
index 25c9bdfc..dc8de03e 100644
--- a/data/rbot/plugins/games/uno.rb
+++ b/data/rbot/plugins/games/uno.rb
@@ -1157,6 +1157,14 @@ class UnoPlugin < Plugin
scores << [v.won.inject(0) { |s, w| s+=w.score }, k]
end
+ if wins.empty?
+ m.reply(_("no %{uno} games were completed here") % {
+ :uno => UnoGame::UNO
+ })
+ return
+ end
+
+
if n = p[:scorenum]
msg = _("%{uno} %{num} highest scores: ") % {
:uno => UnoGame::UNO, :num => p[:scorenum]