]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
wheelfortune: the name of the game chosen by the player is stored for future retrieval
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 7 Dec 2007 19:10:02 +0000 (19:10 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 7 Dec 2007 19:10:02 +0000 (19:10 +0000)
data/rbot/plugins/games/wheelfortune.rb

index d965409f66396276f7e7992540aa6a993618b248..d0178c07b20a11f51cddfb6ae1b3afb11b53af2c 100644 (file)
@@ -221,7 +221,11 @@ class WheelOfFortune < Plugin
       return
     end
     name = p[:name].to_s
-    name = @bot.config['wheelfortune.game_name'] if name.empty?
+    if name.empty?
+      name = m.source.get_botdata("wheelfortune.game_name") || @bot.config['wheelfortune.game_name']
+    else
+      m.source.set_botdata("wheelfortune.game_name", name.dup)
+    end
     @games[ch] = game = WoFGame.new(name, m.botuser, p[:single], p[:max])
     @bot.say chan, _("%{who} just created a new %{name} game to %{max} points (%{single} per question, %{price} per vowel)") % {
       :name => game.name,