diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-02 16:50:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-02 16:50:38 +0300 |
commit | 3a22819ed043fd9effd09c28a9a6d476c5cbd877 (patch) | |
tree | d76452346db25322d6fb6153916bbab7af72de29 /src/net/eathena/inventoryrecv.cpp | |
parent | b9fc37bb6e9b0d16eba0d1bd397eb8199249bdc4 (diff) | |
download | manaverse-3a22819ed043fd9effd09c28a9a6d476c5cbd877.tar.gz manaverse-3a22819ed043fd9effd09c28a9a6d476c5cbd877.tar.bz2 manaverse-3a22819ed043fd9effd09c28a9a6d476c5cbd877.tar.xz manaverse-3a22819ed043fd9effd09c28a9a6d476c5cbd877.zip |
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/inventoryrecv.cpp')
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index f50da9572..a6515640e 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -611,8 +611,11 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) const int index = msg.readInt16("index") - STORAGE_OFFSET; const int amount = msg.readInt32("amount"); const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = static_cast<ItemTypeT>( - msg.readUInt8("type")); + ItemTypeT itemType; + if (msg.getVersion() >= 5) + itemType = static_cast<ItemTypeT>(msg.readUInt8("type")); + else + itemType = ItemType::Unknown; const unsigned char identified = msg.readUInt8("identify"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); |