From f7d34292d6155f0ed467949dc8aec0f0823c725e Mon Sep 17 00:00:00 2001 From: celguar Date: Wed, 31 Jan 2024 02:02:12 +0300 Subject: [PATCH] Possible fix bot replies crash starting with "is" --- playerbot/strategy/actions/SayAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playerbot/strategy/actions/SayAction.cpp b/playerbot/strategy/actions/SayAction.cpp index 50a3c173e..36986f466 100644 --- a/playerbot/strategy/actions/SayAction.cpp +++ b/playerbot/strategy/actions/SayAction.cpp @@ -209,6 +209,8 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32 { verb_pos = i; verb_type = 2; // present + if (verb_pos == 0) + is_quest = 1; } else if (word[i] == "will") { @@ -558,7 +560,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32 msg = "%s, what is a " + word[verb_pos + 1] + "?"; break; case 2: - msg = "yeah i know " + word[verb_pos - 1] + " is a " + word[verb_pos + 1]; + msg = "yeah i know " + word[verb_pos ? verb_pos - 1 : verb_pos + 1] + " is a " + word[verb_pos + 1]; break; } msg = std::regex_replace(msg, std::regex("%s"), name);