mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08: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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
ObjectGuid receiver = sCharacterCache->GetCharacterGuidByName(name);
|
||||
if (!receiver.IsPlayer())
|
||||
if (!receiver || !receiver.IsPlayer() || !ObjectAccessor::FindPlayer(receiver))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user