]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
UNO!: when the game hasn't started, it's nobody's turn
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 9 Dec 2010 10:41:07 +0000 (11:41 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 9 Dec 2010 10:41:07 +0000 (11:41 +0100)
data/rbot/plugins/games/uno.rb

index c689c253224402233f203a7601f50e4d536b6503..751543623313faeca00c1d8a47246fac228b32f6 100644 (file)
@@ -605,6 +605,12 @@ class UnoGame
   end
 
   def show_turn(opts={})
+    if @players.empty?
+      announce _("nobody is playing %{uno} yet!") % {
+        :uno => UNO
+      }
+      return false
+    end
     cards = true
     cards = opts[:cards] if opts.key?(:cards)
     player = @players.first