From f7786f40c4c70e6f72eb49566c8fba020d59af56 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 14 Apr 2008 22:55:05 +0200 Subject: uno plugin: initialize top10 counter both for inline and spread lists --- data/rbot/plugins/games/uno.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index 01db7ff4..7b13beaf 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -1105,8 +1105,8 @@ class UnoPlugin < Plugin } scores.sort! { |a1, a2| -(a1.first <=> a2.first) } scores = scores[0, n.to_i].compact + i = 0 if scores.length <= 5 - i = 0 list = "\n" + scores.map { |a| i+=1 _("%{i}. %{b}%{nick}%{b} with %{b}%{score}%{b} points") % { @@ -1127,8 +1127,8 @@ class UnoPlugin < Plugin } wins.sort! { |a1, a2| -(a1.first <=> a2.first) } wins = wins[0, n.to_i].compact + i = 0 if wins.length <= 5 - i = 0 list = "\n" + wins.map { |a| i+=1 _("%{i}. %{b}%{nick}%{b} with %{b}%{score}%{b} wins") % { -- cgit v1.2.3