From ad8f6fd4136646e251e3d79cef7b7db110364a9b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Mar 2019 00:49:39 +0300 Subject: Fix reading packet len in inventory related packets --- src/net/eathena/inventoryrecv.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 8a0b88dec..e84de0237 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -37,6 +37,7 @@ #include "enums/resources/notifytypes.h" #include "enums/net/deleteitemreason.h" +#include "enums/net/netinventorytype.h" #include "gui/popups/itempopup.h" @@ -1550,7 +1551,7 @@ void InventoryRecv::processInventoryEnd2(Net::MessageIn &msg) void InventoryRecv::processPlayerCombinedInventory1(Net::MessageIn &msg) { UNIMPLEMENTEDPACKET; - const int dataLen = msg.readInt32("len") - 4; + const int dataLen = msg.readInt16("len") - 4; processInventoryContinue(msg, dataLen, NetInventoryType::Storage); @@ -1559,7 +1560,7 @@ void InventoryRecv::processPlayerCombinedInventory1(Net::MessageIn &msg) void InventoryRecv::processPlayerCombinedInventory2(Net::MessageIn &msg) { UNIMPLEMENTEDPACKET; - const int dataLen = msg.readInt32("len") - 5; + const int dataLen = msg.readInt16("len") - 5; const NetInventoryTypeT invType = static_cast( msg.readUInt8("type")); processInventoryContinue(msg, @@ -1592,7 +1593,7 @@ void InventoryRecv::processInventoryContinue(Net::MessageIn &msg, void InventoryRecv::processPlayerCombinedEquipment1(Net::MessageIn &msg) { UNIMPLEMENTEDPACKET; - const int dataLen = msg.readInt32("len") - 4; + const int dataLen = msg.readInt16("len") - 4; processEquipmentContinue(msg, dataLen, NetInventoryType::Storage); @@ -1601,7 +1602,7 @@ void InventoryRecv::processPlayerCombinedEquipment1(Net::MessageIn &msg) void InventoryRecv::processPlayerCombinedEquipment2(Net::MessageIn &msg) { UNIMPLEMENTEDPACKET; - const int dataLen = msg.readInt32("len") - 5; + const int dataLen = msg.readInt16("len") - 5; const NetInventoryTypeT invType = static_cast( msg.readUInt8("type")); processEquipmentContinue(msg, -- cgit v1.2.3-60-g2f50