From 9c4a1a99a5850e5a50fe460d9866e04c333e063f Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Fri, 9 Apr 2021 03:24:54 -0500 Subject: [PATCH] Minor tweak to /8ball clean up that code and fix the index --- src/commands.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands.cpp b/src/commands.cpp index b642cba..ff842a8 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1254,8 +1254,7 @@ void AOClient::cmd8Ball(int argc, QStringList argv) sendServerMessage("8ball.txt is empty."); } else { - int answerindex = server->magic_8ball_answers.size(); - QString response = server->magic_8ball_answers[(genRand(1, answerindex))]; + QString response = server->magic_8ball_answers[(genRand(1, server->magic_8ball_answers.size() - 1))]; QString sender_name = ooc_name; QString sender_message = argv.join(" ");