]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/games/uno.rb
uno plugin: fix check for card presence
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / games / uno.rb
index 764373cffc266d2163ab55f895ba16d0c14625f4..fdedc1447f7153cbb28762e983ec968a0b3b5a1d 100644 (file)
@@ -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