summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-09 23:09:11 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-09 23:09:11 +0200
commitb1155710d58091f8a3c5db6f764eeb6a6dd36b2a (patch)
tree47b92bff3b53dc99268eb3d106619cd7151f41ea
parent9718c29c6e9daf9227d0a750e6419640eff50276 (diff)
uno plugin: don't trigger in-game commands if they have parameters they shouldn't have
-rw-r--r--data/rbot/plugins/games/uno.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb
index 877d95c4..764373cf 100644
--- a/data/rbot/plugins/games/uno.rb
+++ b/data/rbot/plugins/games/uno.rb
@@ -557,8 +557,10 @@ class UnoPlugin < Plugin
g = @games[m.channel]
case m.plugin.intern
when :jo # join game
+ return if m.params
g.add_player(m.source)
when :pe # pick card
+ return if m.params
if g.has_turn?(m.source)
if g.player_has_picked
m.reply _("you already picked a card")
@@ -571,6 +573,7 @@ class UnoPlugin < Plugin
m.reply _("It's not your turn")
end
when :pa # pass turn
+ return if m.params
if g.has_turn?(m.source)
g.pass(m.source)
else
@@ -589,17 +592,22 @@ class UnoPlugin < Plugin
m.reply _("It's not your turn")
end
when :ca # show current cards
+ return if m.params
g.show_all_cards(m.source)
when :cd # show current discard
+ return if m.params
g.show_discard
# TODO
# when :ch
# g.challenge
when :od # show playing order
+ return if m.params
g.show_order
when :ti # show play time
+ return if m.params
g.show_time
when :tu # show whose turn is it
+ return if m.params
if g.has_turn?(m.source)
m.nickreply _("it's your turn, sleepyhead")
else