TrinityCore / WowPacketParser

World of Warcraft Packet Parser
GNU General Public License v3.0
419 stars 354 forks source link

Fix Classic TBC Update Object parsing using wrong ObjectType enum #679

Closed killerwife closed 2 years ago

ratkosrb commented 2 years ago

I think it changed in 2.5.4.

killerwife commented 2 years ago

You are right, will fix.

killerwife commented 2 years ago

Fixed

ratkosrb commented 2 years ago

They changed it to ObjectType801 in 2.5.4. Also since 1.14 uses the same handlers, you should check the 1.14 build here too and specify branch. And the HeirFlags can be read within the same if block, since it changed at the same time.

ObjectType objType;
if (ClientVersion.RemovedInVersion(ClientBranch.Classic, ClientVersionBuild.V1_14_3_42770) || 
    ClientVersion.RemovedInVersion(ClientBranch.TBC, ClientVersionBuild.V2_5_4_42695))
{
    objType = ObjectTypeConverter.Convert(packet.ReadByteE<ObjectTypeBCC>("Object Type", index));
    packet.ReadInt32("HeirFlags", index);
}
else
    objType = ObjectTypeConverter.Convert(packet.ReadByteE<ObjectType801>("Object Type", index));