From a50f671afd0c17b768aa1dd73d3d63476ff5523c Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 10 Dec 2020 23:09:19 +0100 Subject: Core/PacketIO: Fixed client crashes with SMSG_UPDATE_TALENT_DATA Closes #25701 --- src/server/game/Entities/Player/Player.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 56ff90ccb56..2fd5fefc983 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -26964,7 +26964,6 @@ void Player::SendTalentsInfoData() { WorldPackets::Talent::UpdateTalentData packet; packet.Info.PrimarySpecialization = GetPrimarySpecialization(); - packet.Info.ActiveGroup = GetActiveTalentGroup(); for (uint8 i = 0; i < MAX_SPECIALIZATIONS; ++i) { @@ -27030,7 +27029,11 @@ void Player::SendTalentsInfoData() pvpTalent.Slot = slot; } - packet.Info.TalentGroups.push_back(groupInfoPkt); + if (i == GetActiveTalentGroup()) + packet.Info.ActiveGroup = packet.Info.TalentGroups.size(); + + if (!groupInfoPkt.TalentIDs.empty() || !groupInfoPkt.PvPTalents.empty() || i == GetActiveTalentGroup()) + packet.Info.TalentGroups.push_back(groupInfoPkt); } SendDirectMessage(packet.Write()); -- cgit v1.2.3