diff options
author | Dmitry Kim <dmitry point kim at gmail point com> | 2007-07-17 02:02:42 +0000 |
---|---|---|
committer | Dmitry Kim <dmitry point kim at gmail point com> | 2007-07-17 02:02:42 +0000 |
commit | 2d39231c4c955e4131aba021e70ddcfb732db31a (patch) | |
tree | c62c1806341dfb3db001d40c48f9081e86063a44 /data/rbot/plugins/games | |
parent | 43a9b5b6faca96ea401bb7aa580a51bea715cd74 (diff) |
* (games/roulette) twice-in-a-row logic was very, very broken.
Diffstat (limited to 'data/rbot/plugins/games')
-rw-r--r-- | data/rbot/plugins/games/roulette.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/data/rbot/plugins/games/roulette.rb b/data/rbot/plugins/games/roulette.rb index 3b954077..7c25a6cc 100644 --- a/data/rbot/plugins/games/roulette.rb +++ b/data/rbot/plugins/games/roulette.rb @@ -15,6 +15,7 @@ class RoulettePlugin < Plugin super reset_chambers @players = Array.new + @last = '' end def help(plugin, topic="") @@ -46,11 +47,12 @@ class RoulettePlugin < Plugin totals = RouletteHistory.new(0,0,0,0,0) end - if @players.last == m.sourcenick and not @bot.config['roulette.twice_in_a_row'] + if @last == m.sourcenick and not @bot.config['roulette.twice_in_a_row'] m.reply "you can't go twice in a row!" return end + @last = m.sourcenick unless @players.include?(m.sourcenick) @players << m.sourcenick playerdata.games += 1 @@ -72,6 +74,7 @@ class RoulettePlugin < Plugin @registry["player " + plyr] = pdata } @players.clear + @last = '' @bot.kick(m.replyto, m.sourcenick, "*BANG*") if @bot.config['roulette.kick'] else m.reply "#{m.sourcenick}: chamber #{6 - @chambers.length} of 6 => +click+" @@ -118,6 +121,7 @@ class RoulettePlugin < Plugin @registry["totals"] = totals @players.clear + @last = '' end def spin(m, params={}) |