summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-09 21:47:21 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-09 21:47:21 +0200
commit28414ec3a9ea3153a001102241bc1feb46ba4a38 (patch)
tree7eaa2c4445dc33c07acab8a4aab9c899e6a86871 /data
parentfb33606c5a7e2aa75c11bb5282987138920c8bde (diff)
uno plugin: fix playability check for Reverse vs +x
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/games/uno.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb
index 1d49642c..0b7f8ba6 100644
--- a/data/rbot/plugins/games/uno.rb
+++ b/data/rbot/plugins/games/uno.rb
@@ -279,13 +279,11 @@ class UnoGame
def can_play(card)
# When a +something is online, you can only play
- # a +something of same or higher something, or a Reverse
+ # a +something of same or higher something, or a Reverse of
+ # the correct color
# TODO make optional
if @picker > 0
- if card.color and card.color != @color
- return false
- end
- if card.value == 'Reverse' or card.picker >= @discard.picker
+ if (card.value == 'Reverse' and card.color == @color) or card.picker >= @discard.picker
return true
else
return false