summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-03-02 00:49:39 +0300
committerAndrei Karas <akaras@inbox.ru>2019-03-02 00:49:39 +0300
commitad8f6fd4136646e251e3d79cef7b7db110364a9b (patch)
treef0ace4d61d9fee5ca9dfc6da6ef1e6bef9a92ef6
parent50e0705465eb2dd3e08fe94c9206348b6abd5995 (diff)
downloadmanaplus-ad8f6fd4136646e251e3d79cef7b7db110364a9b.tar.gz
manaplus-ad8f6fd4136646e251e3d79cef7b7db110364a9b.tar.bz2
manaplus-ad8f6fd4136646e251e3d79cef7b7db110364a9b.tar.xz
manaplus-ad8f6fd4136646e251e3d79cef7b7db110364a9b.zip
Fix reading packet len in inventory related packets
-rw-r--r--src/net/eathena/inventoryrecv.cpp9
1 files 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<NetInventoryTypeT>(
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<NetInventoryTypeT>(
msg.readUInt8("type"));
processEquipmentContinue(msg,