From 5d6f0d64015fc83fadd890db950af4c7b1e6e40c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 13 Dec 2020 18:16:04 -0500 Subject: [PATCH] Core/PacketIO: Fixed client crashes with SMSG_UPDATE_TALENT_DATA Port From (https://github.com/TrinityCore/TrinityCore/commit/a50f671afd0c17b768aa1dd73d3d63476ff5523c) --- Source/Game/Entities/Player/Player.Talents.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Talents.cs b/Source/Game/Entities/Player/Player.Talents.cs index 76528cf92..2569e7e14 100644 --- a/Source/Game/Entities/Player/Player.Talents.cs +++ b/Source/Game/Entities/Player/Player.Talents.cs @@ -549,7 +549,6 @@ namespace Game.Entities { UpdateTalentData packet = new UpdateTalentData(); packet.Info.PrimarySpecialization = GetPrimarySpecialization(); - packet.Info.ActiveGroup = GetActiveTalentGroup(); for (byte i = 0; i < PlayerConst.MaxSpecializations; ++i) { @@ -607,7 +606,11 @@ namespace Game.Entities groupInfoPkt.PvPTalentIDs.Add((ushort)pvpTalents[slot]); } - packet.Info.TalentGroups.Add(groupInfoPkt); + if (i == GetActiveTalentGroup()) + packet.Info.ActiveGroup = (byte)packet.Info.TalentGroups.Count; + + if (!groupInfoPkt.TalentIDs.Empty() || !groupInfoPkt.PvPTalentIDs.Empty() || i == GetActiveTalentGroup()) + packet.Info.TalentGroups.Add(groupInfoPkt); } SendPacket(packet);