diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-04-09 23:45:21 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-04-09 23:45:21 +0200 |
commit | 27cb79be57f9377d8c13dab2d7d0776e80dfd115 (patch) | |
tree | 730248a95df44c0d7b1faa707cc90a99b5a67d2b /data | |
parent | 282909e0ef97ab3045254920dcee5eab2be25505 (diff) |
uno plugin: fix check for card presence
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/games/uno.rb | 12 |
1 files 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 |