diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 5eee9bc0..39f946b7 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -3620,5 +3620,5 @@ bool PlayerbotAI::IsInRealGuild() void PlayerbotAI::QueueChatResponse(uint8 msgtype, ObjectGuid guid1, ObjectGuid guid2, std::string message, std::string chanName, std::string name) { - chatReplies.push(ChatQueuedReply(msgtype, guid1.GetCounter(), guid2.GetCounter(), message, chanName, name, time(0) + urand(inCombat ? 10 : 5, inCombat ? 25 : 15))); + chatReplies.push(ChatQueuedReply(msgtype, guid1.GetCounter(), guid2.GetCounter(), message, chanName, name, time(nullptr) + urand(inCombat ? 10 : 5, inCombat ? 25 : 15))); } \ No newline at end of file diff --git a/src/strategy/actions/SayAction.cpp b/src/strategy/actions/SayAction.cpp index ba601e86..074b4e22 100644 --- a/src/strategy/actions/SayAction.cpp +++ b/src/strategy/actions/SayAction.cpp @@ -600,7 +600,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32 if (type == CHAT_MSG_WHISPER) { ObjectGuid receiver = sCharacterCache->GetCharacterGuidByName(name); - if (!receiver.IsPlayer()) + if (!receiver || !receiver.IsPlayer() || !ObjectAccessor::FindPlayer(receiver)) { return; }