feat(Core/ChatHandler): ignore chat level requirement when whispering self (#15564)
feat(Core/ChatHandler): ignore chat level requirement when whispering self
This commit is contained in:
@@ -367,12 +367,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||||||
break;
|
break;
|
||||||
case CHAT_MSG_WHISPER:
|
case CHAT_MSG_WHISPER:
|
||||||
{
|
{
|
||||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
|
||||||
{
|
|
||||||
SendNotification(GetAcoreString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!normalizePlayerName(to))
|
if (!normalizePlayerName(to))
|
||||||
{
|
{
|
||||||
SendPlayerNotFoundNotice(to);
|
SendPlayerNotFoundNotice(to);
|
||||||
@@ -382,6 +376,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
|||||||
Player* receiver = ObjectAccessor::FindPlayerByName(to, false);
|
Player* receiver = ObjectAccessor::FindPlayerByName(to, false);
|
||||||
bool senderIsPlayer = AccountMgr::IsPlayerAccount(GetSecurity());
|
bool senderIsPlayer = AccountMgr::IsPlayerAccount(GetSecurity());
|
||||||
bool receiverIsPlayer = AccountMgr::IsPlayerAccount(receiver ? receiver->GetSession()->GetSecurity() : SEC_PLAYER);
|
bool receiverIsPlayer = AccountMgr::IsPlayerAccount(receiver ? receiver->GetSession()->GetSecurity() : SEC_PLAYER);
|
||||||
|
|
||||||
|
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && receiver != sender)
|
||||||
|
{
|
||||||
|
SendNotification(GetAcoreString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!receiver || (senderIsPlayer && !receiverIsPlayer && !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID())))
|
if (!receiver || (senderIsPlayer && !receiverIsPlayer && !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID())))
|
||||||
{
|
{
|
||||||
SendPlayerNotFoundNotice(to);
|
SendPlayerNotFoundNotice(to);
|
||||||
|
|||||||
Reference in New Issue
Block a user