Skip to content

Commit

Permalink
Possible fix bot replies crash starting with "is"
Browse files Browse the repository at this point in the history
  • Loading branch information
celguar committed Jan 30, 2024
1 parent 5bba90a commit f7d3429
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion playerbot/strategy/actions/SayAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f7d3429

Please sign in to comment.