diff options
author | Spencer Rinehart <anubis@overthemonkey.com> | 2009-02-26 20:27:55 -0500 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-02-27 22:57:42 +0100 |
commit | 3847836a3ce7d075fc160fa3cf63b18433839c8b (patch) | |
tree | aea9fc0a5b2477134c3dae1c599ec937a075a98d /data | |
parent | 1ac529cac1536e4f05bdef10cc6b387b45be74c7 (diff) |
hangman: fix score fetching to work for offline users.
m.server.get_user doesn't work for offline users so use what was given
instead.
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/games/hangman.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/data/rbot/plugins/games/hangman.rb b/data/rbot/plugins/games/hangman.rb index af0d9d9c..d571fd78 100644 --- a/data/rbot/plugins/games/hangman.rb +++ b/data/rbot/plugins/games/hangman.rb @@ -441,18 +441,18 @@ class HangmanPlugin < Plugin else return unless m.public? - user = m.server.get_user(params[:nick]) - stats = @stats.player_stats(target)[user] + nick = params[:nick] + stats = @stats.player_stats(target)[nick] unless stats.played.zero? m.reply _("%{nick} has %{score} points after %{games} games") % { - :nick => user.nick, + :nick => nick, :score => stats.score.round, :games => stats.played } else m.reply _("%{nick} hasn't played hangman :(") % { - :nick => user.nick + :nick => nick } end end @@ -491,4 +491,4 @@ plugin.map "hangman stop", :action => 'stop' plugin.map "hangman score [:nick]", :action => 'score' plugin.map "hangman stats", :action => 'stats' -plugin.map "define", :action => 'define'
\ No newline at end of file +plugin.map "define", :action => 'define' |