summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-02 22:14:54 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-02 22:14:54 +0300
commit3f8ef45a5f6918d2e0e9e25533e77133f0192464 (patch)
tree1eef39e2641ffdbdd0673e44b42c696906e38503 /src/net/eathena/inventoryrecv.cpp
parent8673aefdfd509e7d8e1c3585fee996a90d543068 (diff)
downloadmanaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.gz
manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.bz2
manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.tar.xz
manaplus-3f8ef45a5f6918d2e0e9e25533e77133f0192464.zip
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/inventoryrecv.cpp')
-rw-r--r--src/net/eathena/inventoryrecv.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 8add24d77..8a809c825 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -852,8 +852,12 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg)
const int index = msg.readInt16("index") - INVENTORY_OFFSET;
int amount = msg.readInt32("count");
const int itemId = msg.readInt16("item id");
- const ItemTypeT itemType = static_cast<ItemTypeT>(
- msg.readUInt8("item type"));
+ ItemTypeT itemType = ItemType::Unknown;
+ if (msg.getVersion() >= 5)
+ {
+ itemType = static_cast<ItemTypeT>(
+ msg.readUInt8("item type"));
+ }
const uint8_t identified = msg.readUInt8("identified");
const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged);
const uint8_t refine = msg.readUInt8("refine");