diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-12-10 23:09:19 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-12-10 23:09:19 +0100 |
commit | a50f671afd0c17b768aa1dd73d3d63476ff5523c (patch) | |
tree | 6025dcf7c4bfa9cde545724f112436e31ca227a2 /src | |
parent | bd0a0110322151eb0efdc8faabb7f9dc5ce85e18 (diff) |
Core/PacketIO: Fixed client crashes with SMSG_UPDATE_TALENT_DATA
Closes #25701
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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()); |