diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-02 22:45:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-02 22:45:33 +0300 |
commit | c2b28b1860ce02a4e9b9b6694e801de83652440e (patch) | |
tree | a075b59576032f724dce86f17825cac59f7b8487 /src/net/eathena/inventoryrecv.cpp | |
parent | 3f8ef45a5f6918d2e0e9e25533e77133f0192464 (diff) | |
download | plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.gz plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.bz2 plus-c2b28b1860ce02a4e9b9b6694e801de83652440e.tar.xz plus-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.cpp | 12 |
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) { |