Skip to content

Commit

Permalink
Properly fix ItemInstance 4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
funjoker committed Nov 17, 2024
1 parent 792ce0f commit d994886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions WowPacketParserModule.Substructures/ItemHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ public static ItemInstance ReadItemInstance441(Packet packet, params object[] in
instance.ItemID = packet.ReadInt32<ItemId>("ItemID", indexes);
instance.RandomPropertiesSeed = packet.ReadUInt32("RandomPropertiesSeed", indexes);
instance.RandomPropertiesID = packet.ReadUInt32("RandomPropertiesID", indexes);


packet.ResetBitReader();
var hasBonuses = packet.ReadBit("HasItemBonus", indexes);
packet.ResetBitReader();

var modificationCount = packet.ReadBits(6);
packet.ResetBitReader();

for (var j = 0u; j < modificationCount; ++j)
{
ItemModifier mod = packet.ReadByteE<ItemModifier>();
Expand Down
6 changes: 2 additions & 4 deletions WowPacketParserModule.V4_4_0_54481/Parsers/QuestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public static void ReadPlayerChoiceResponse(Packet packet, int choiceId, uint in

public static ItemInstance ReadRewardItem(Packet packet, params object[] idx)
{
packet.ReadBitsE<LootItemType>("LootItemType", 2, idx);
packet.ResetBitReader();
packet.ReadBitsE<LootItemType>("LootItemType", 2, idx);
var itemInstance = Substructures.ItemHandler.ReadItemInstance(packet, idx);

packet.ReadInt32("Quantity", idx);
Expand Down Expand Up @@ -233,13 +233,11 @@ public static void ReadQuestRewards441(Packet packet, params object[] idx)
for (var i = 0; i < treasurePickerCount; ++i)
packet.ReadInt32("TreasurePickerID", idx, i);

packet.ResetBitReader();

for (var i = 0; i < 6; ++i)
ReadRewardItem(packet, idx, "ItemChoiceData", i);

packet.ReadBit("IsBoostSpell", idx);
packet.ResetBitReader();
packet.ReadBit("IsBoostSpell", idx);
}

public static QuestOfferReward ReadQuestGiverOfferRewardData(Packet packet, params object[] indexes)
Expand Down

0 comments on commit d994886

Please sign in to comment.