summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-02 22:45:33 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-02 22:45:33 +0300
commitc2b28b1860ce02a4e9b9b6694e801de83652440e (patch)
treea075b59576032f724dce86f17825cac59f7b8487 /src/net/eathena/inventoryrecv.cpp
parent3f8ef45a5f6918d2e0e9e25533e77133f0192464 (diff)
downloadmv-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.gz
mv-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.bz2
mv-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.xz
mv-c2b28b1860ce02a4e9b9b6694e801de83652440e.zip
Sort more packets. Add version checks inside packets.
Diffstat (limited to 'src/net/eathena/inventoryrecv.cpp')
-rw-r--r--src/net/eathena/inventoryrecv.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 8a809c825..9587da970 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -198,12 +198,18 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
int cards[maxCards];
for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
- const int equipType = msg.readInt32("location");
+ int equipType;
+ if (msg.getVersion() >= 20120925)
+ equipType = msg.readInt32("location");
+ else
+ equipType = msg.readInt16("location");
const ItemTypeT itemType = static_cast<ItemTypeT>(
msg.readUInt8("item type"));
const unsigned char err = msg.readUInt8("result");
- msg.readInt32("hire expire date");
- msg.readInt16("bind on equip");
+ if (msg.getVersion() >= 20061218)
+ msg.readInt32("hire expire date");
+ if (msg.getVersion() >= 20071002)
+ msg.readInt16("bind on equip");
if ((serverVersion >= 8 || serverVersion == 0) &&
msg.getVersion() >= 20150226)
{