Do not whisper unreachable players

This commit is contained in:
郑佩茹
2022-10-07 12:27:41 -06:00
parent 5d0aa407d6
commit 1c09fa5377
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}