From ed6ecc160458aa1288691f833c251f6dba4b3ed6 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 7 Jan 2007 16:23:01 +0000 Subject: Make sure the quiz plugin doesn't fail when win messages haven't been found --- data/rbot/plugins/quiz.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/quiz.rb b/data/rbot/plugins/quiz.rb index 2757c4a0..67cd15b8 100644 --- a/data/rbot/plugins/quiz.rb +++ b/data/rbot/plugins/quiz.rb @@ -101,6 +101,8 @@ class QuizPlugin < Plugin IO.foreach("#{@bot.botclass}/quiz/win_messages") { |line| @win_messages << line.chomp } else warning( "win_messages file not found!" ) + # Fill the array with a least one message or code accessing it would fail + @win_messages << " guessed right! The answer was " end # TODO: Make this configurable, and add support for more than one file (there's a size limit in linux too ;) ) -- cgit v1.2.3