fix(core): "Silenced - You can only chat with GMs" spell (#2716)

This commit is contained in:
Amin.MasterkinG
2020-04-04 13:31:11 +04:30
committed by GitHub
parent 397c5d916f
commit 378cd6fe28

View File

@@ -97,6 +97,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
return;
}
}
if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
{
SendNotification(GetAcoreString(LANG_GM_SILENCE), sender->GetName().c_str());
recvData.rfinish();
return;
}
// prevent talking at unknown language (cheating)
LanguageDesc const* langDesc = GetLanguageDescByID(lang);
@@ -236,14 +243,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
sender->UpdateSpeakTime(specialMessageLimit);
}
// pussywizard: optimization
/*if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
{
SendNotification(GetAcoreString(LANG_GM_SILENCE), sender->GetName().c_str());
recvData.rfinish();
return;
}*/
std::string to, channel, msg;
bool ignoreChecks = false;
switch (type)
@@ -386,11 +385,11 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
}
// pussywizard: optimization
/*if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(GetAcoreString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
return;
}*/
}
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
if (!senderIsPlayer && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))