Core/Chat: Control CHAT_MSG_PARTY_LEADER serverside

Closes #14868
Closes #29689
This commit is contained in:
Shauren
2024-02-23 14:21:05 +01:00
parent 39fd26ef41
commit e835ab5014

View File

@@ -381,8 +381,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
return;
}
if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID()))
return;
// control LEADER messages on the server
// in a scenario where player has both Group and OriginalGroup,
// client will incorrectly send LEADER type when sending message to OriginalGroup while being a leader in regular group
type = group->IsLeader(sender->GetGUID()) ? CHAT_MSG_PARTY_LEADER : CHAT_MSG_PARTY;
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);