mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-06 04:13:48 +00:00
Do not whisper unreachable players
This commit is contained in:
@@ -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)
|
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)));
|
||||||
}
|
}
|
||||||
@@ -600,7 +600,7 @@ void ChatReplyAction::ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32
|
|||||||
if (type == CHAT_MSG_WHISPER)
|
if (type == CHAT_MSG_WHISPER)
|
||||||
{
|
{
|
||||||
ObjectGuid receiver = sCharacterCache->GetCharacterGuidByName(name);
|
ObjectGuid receiver = sCharacterCache->GetCharacterGuidByName(name);
|
||||||
if (!receiver.IsPlayer())
|
if (!receiver || !receiver.IsPlayer() || !ObjectAccessor::FindPlayer(receiver))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user