From 27cb79be57f9377d8c13dab2d7d0776e80dfd115 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 9 Apr 2008 23:45:21 +0200 Subject: uno plugin: fix check for card presence --- data/rbot/plugins/games/uno.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index 764373cf..fdedc144 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -126,14 +126,14 @@ class UnoGame @cards = [] end def has_card?(short) - cards = [] + has = [] @cards.each { |c| - cards << c if c.shortform == short + has << c if c.shortform == short } - if cards.empty? + if has.empty? return false else - return cards + return has end end def to_s @@ -352,8 +352,10 @@ class UnoGame announce _("%{p}, choose a color with: co r|b|g|y") % { :p => p } end else - announce _("you don't have that card") + announce _("you don't have two cards of that kind") end + else + announce _("you don't have that card") end end -- cgit v1.2.3