From 366b880a8dd4429ab623a34e60e1bce9e6e68c43 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 11 Nov 2008 20:21:29 +0100 Subject: UNO plugin: handle empty top lists --- data/rbot/plugins/games/uno.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'data') 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] -- cgit v1.2.3