forked from mirror/azerothcore-wotlk
fix(Core/PacketsIO): Send correct messages about server first achievements depending on faction. (#3379)
This commit is contained in:
@@ -675,13 +675,19 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
|
||||
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
TeamId teamId = GetPlayer()->GetTeamId();
|
||||
|
||||
// broadcast realm first reached
|
||||
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetPlayer()->GetName().size() + 1 + 8 + 4 + 4);
|
||||
data << GetPlayer()->GetName();
|
||||
data << uint64(GetPlayer()->GetGUID());
|
||||
data << uint32(achievement->ID);
|
||||
data << uint32(0); // 1=link supplied string as player name, 0=display plain string
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
std::size_t linkTypePos = data.wpos();
|
||||
data << uint32(1); // display name as clickable link in chat
|
||||
sWorld->SendGlobalMessage(&data, nullptr, teamId);
|
||||
|
||||
data.put<uint32>(linkTypePos, 0); // display name as plain string in chat
|
||||
sWorld->SendGlobalMessage(&data, nullptr, teamId == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
}
|
||||
// if player is in world he can tell his friends about new achievement
|
||||
else if (GetPlayer()->IsInWorld())
|
||||
|
||||
Reference in New Issue
Block a user