From: Mark Kretschmann Date: Mon, 4 Sep 2006 09:08:37 +0000 (+0000) Subject: Fix regression in the quiz plugin: The same winning messages would be repeated over... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=9c5bfe75338fac268d5baf476729017c5b132c08;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Fix regression in the quiz plugin: The same winning messages would be repeated over and over again. --- diff --git a/data/rbot/plugins/quiz.rb b/data/rbot/plugins/quiz.rb index 9e7aa454..eeef338e 100644 --- a/data/rbot/plugins/quiz.rb +++ b/data/rbot/plugins/quiz.rb @@ -264,7 +264,7 @@ class QuizPlugin < Plugin elsif q.rank_table.length >= 3 and m.sourcenick.to_s == q.rank_table[2][0] reply = "THE THIRD CHAMPION strikes again! Give it all #{m.sourcenick.to_s}, with #{q.rank_table[1][1].score - q.rank_table[2][1].score - 1} more points you'll reach the 2nd place! Answer was: #{q.answer}" else - reply = @win_messages[rand( @win_messages.length )] + reply = @win_messages[rand( @win_messages.length )].dup reply.gsub!( "", m.sourcenick ) reply.gsub!( "", q.answer ) end