summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-11-08 20:25:06 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-11-08 20:25:06 +0100
commit6eed70298a021fc6b789936c8fa7e591ac6427be (patch)
tree52b091b09e071f376bccbb1ccfb1c4a889a58722
parent93be58cf16a0e1d993e2636493565d311e208f19 (diff)
UNO!: fix g9r9 fix
Commit a306b2c68eb58c1c88057ff7ee78895401adb6a9 introduced a fix to prevent a player from playing something like g9r9, but the fix actually prevented any single-card play. Fix by making the \1 optional.
-rw-r--r--data/rbot/plugins/games/uno.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb
index adaa127f..6a056278 100644
--- a/data/rbot/plugins/games/uno.rb
+++ b/data/rbot/plugins/games/uno.rb
@@ -382,7 +382,7 @@ class UnoGame
def play_card(source, cards)
debug "Playing card #{cards}"
p = get_player(source)
- shorts = cards.gsub(/\s+/,'').match(/^(?:([rbgy]\+?\d)\1|([rbgy][rs])|(w(?:\+4)?)([rbgy])?)$/).to_a
+ shorts = cards.gsub(/\s+/,'').match(/^(?:([rbgy]\+?\d)\1?|([rbgy][rs])|(w(?:\+4)?)([rbgy])?)$/).to_a
debug shorts.inspect
if shorts.empty?
announce _("what cards were that again?")