From edde7610c9010b9cc0a8a20436c62652795d1b6f Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 22 Sep 2011 22:42:02 +0200 Subject: [PATCH] UNO: prevent player from replaying a misplayed card --- data/rbot/plugins/games/uno.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index ab0ea161..df6a1eee 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -515,7 +515,7 @@ class UnoGame announce _("%{lp}'s move was %{b}not%{b} legal, %{lp} must pick %{b}%{n}%{b} cards and play again!") % { :cp => cp, :lp => lp, :b => Bold, :n => @picker } - lp.cards << @discard # put the W+4 back in place + played = @discard # store the misplayed W+4 # reset the discard @color = @last_color.dup @@ -527,7 +527,10 @@ class UnoGame # force the player to play the current cards @must_play = lp.cards.dup + # but not the same (type of) card he misplayed, though + @must_play.delete(played) + lp.cards << played # reinstate the W+4 in the list of player cards # give him the penalty cards deal(lp, @picker) @picker = 0 -- 2.39.2