summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-02 16:50:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-02 16:50:38 +0300
commit3a22819ed043fd9effd09c28a9a6d476c5cbd877 (patch)
treed76452346db25322d6fb6153916bbab7af72de29 /src/net/eathena/inventoryrecv.cpp
parentb9fc37bb6e9b0d16eba0d1bd397eb8199249bdc4 (diff)
downloadManaVerse-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.cpp7
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");