Fix crash

This commit is contained in:
Atidot3
2024-07-25 17:56:53 +02:00
parent 710d89af5c
commit 916a0002e8
4 changed files with 13 additions and 10 deletions

View File

@@ -661,15 +661,16 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
LOG_ERROR("playerbots", "plr pointer is nullptr chat whisper");
}
if (type == CHAT_MSG_SAY)
else if (type == CHAT_MSG_SAY)
{
LOG_INFO("playerbots", "say respond: {}", respondsText);
if (bot->GetTeamId() == TEAM_ALLIANCE)
bot->Say(respondsText, LANG_COMMON);
else
bot->Say(respondsText, LANG_ORCISH);
}
if (type == CHAT_MSG_YELL)
else if (type == CHAT_MSG_YELL)
{
if (bot->GetTeamId() == TEAM_ALLIANCE)
bot->Yell(respondsText, LANG_COMMON);
@@ -677,7 +678,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
bot->Yell(respondsText, LANG_ORCISH);
}
if (type == CHAT_MSG_GUILD)
else if (type == CHAT_MSG_GUILD)
{
if (!bot->GetGuildId())
return;
@@ -696,4 +697,4 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
}
GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<time_t>("last said", "chat")->Set(time(nullptr) + urand(5, 25));
}
}
}