From 9e0eac83bf3a05aa64e0222ddad052c84bfbdee2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 15 Dec 2020 16:27:55 +0100 Subject: [PATCH] Core/PacketIO: Add missing ByteBuffer::ResetBitPos calls, fixes buying items from vendors Closes #25729 --- src/server/game/Server/Packets/ItemPacketsCommon.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Server/Packets/ItemPacketsCommon.cpp b/src/server/game/Server/Packets/ItemPacketsCommon.cpp index 79f7a4a61b0..0481119c8cc 100644 --- a/src/server/game/Server/Packets/ItemPacketsCommon.cpp +++ b/src/server/game/Server/Packets/ItemPacketsCommon.cpp @@ -182,6 +182,7 @@ ByteBuffer& operator<<(ByteBuffer& data, ItemModList const& itemModList) ByteBuffer& operator>>(ByteBuffer& data, ItemModList& itemModList) { itemModList.Values.resize(data.ReadBits(6)); + data.ResetBitPos(); for (ItemMod& itemMod : itemModList.Values) data >> itemMod; @@ -248,6 +249,7 @@ ByteBuffer& operator>>(ByteBuffer& data, ItemGemData& itemGemData) ByteBuffer& operator>>(ByteBuffer& data, InvUpdate& invUpdate) { invUpdate.Items.resize(data.ReadBits(2)); + data.ResetBitPos(); for (InvUpdate::InvItem& item : invUpdate.Items) { data >> item.ContainerSlot;