From 7b04b9ef4a2d1f16332447897b69422c7c7d5d6f Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Sat, 18 Jun 2016 23:36:13 -0700 Subject: [PATCH] Fix for #bot command crashing the zone when sent with no text following "#bot" --- zone/command.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index c52b613db..c7aaef59a 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10848,8 +10848,13 @@ void command_reloadperlexportsettings(Client *c, const Seperator *sep) void command_bot(Client *c, const Seperator *sep) { std::string bot_message = sep->msg; - bot_message = bot_message.substr(bot_message.find_first_not_of("#bot")); - bot_message[0] = BOT_COMMAND_CHAR; + if (bot_message.compare("#bot") == 0) { + bot_message[0] = BOT_COMMAND_CHAR; + } + else { + bot_message = bot_message.substr(bot_message.find_first_not_of("#bot")); + bot_message[0] = BOT_COMMAND_CHAR; + } if (bot_command_dispatch(c, bot_message.c_str()) == -2) { if (parse->PlayerHasQuestSub(EVENT_COMMAND)) {