diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-22 20:00:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-22 20:00:55 +0300 |
commit | b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191 (patch) | |
tree | 89a6497e681fe746b626d94e27fd52745b83b498 /src/net/eathena/inventoryrecv.cpp | |
parent | d4b58f6dce665979a615cf5b73521ee37140e1d0 (diff) | |
download | plus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.gz plus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.bz2 plus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.tar.xz plus-b44bcbdbaa5eb7f278444b8b48dbe6b8f6345191.zip |
Fix packet version usage for hercules without evol plugin.
Diffstat (limited to 'src/net/eathena/inventoryrecv.cpp')
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 8bc93208f..d282af05e 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -111,10 +111,15 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) equipment->setBackend(&Ea::InventoryRecv::mEquips); } int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4) / sz; @@ -132,7 +137,8 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) msg.readInt32("hire expire date (?)"); msg.readInt16("equip type"); msg.readInt16("item sprite number"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) @@ -196,7 +202,8 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) const unsigned char err = msg.readUInt8("result"); msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -503,10 +510,15 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) BLOCK_START("InventoryRecv::processPlayerStorageEquip") msg.readInt16("len"); int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4 - 24) / sz; msg.readString(24, "storage name"); @@ -525,7 +537,8 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); msg.readInt16("sprite"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) @@ -569,7 +582,8 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -770,7 +784,8 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg) int cards[maxCards]; for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { for (int f = 0; f < 5; f ++) { @@ -823,10 +838,15 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) BLOCK_START("InventoryRecv::processPlayerCartEquip") msg.readInt16("len"); int sz; - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) + { sz = 57; + } else + { sz = 31; + } const int number = (msg.getLength() - 4) / sz; for (int loop = 0; loop < number; loop++) @@ -844,7 +864,8 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); msg.readInt16("sprite"); - if (serverVersion >= 8 && packetVersion >= 20150226) + if ((serverVersion >= 8 || serverVersion == 0) && + packetVersion >= 20150226) { msg.readUInt8("rnd count"); for (int f = 0; f < 5; f ++) |