diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-03 13:16:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:56 +0300 |
commit | cb392d4bf99ff06849f5891a17be59a7e509ff98 (patch) | |
tree | 38cce73e116b1eedd19ddd5e7e146b0879d4fe31 /src/net | |
parent | bfa9351f768f20b591cccdbb24eb546dfb59e27d (diff) | |
download | plus-cb392d4bf99ff06849f5891a17be59a7e509ff98.tar.gz plus-cb392d4bf99ff06849f5891a17be59a7e509ff98.tar.bz2 plus-cb392d4bf99ff06849f5891a17be59a7e509ff98.tar.xz plus-cb392d4bf99ff06849f5891a17be59a7e509ff98.zip |
eathena: fix packet SMSG_PLAYER_INVENTORY_ADD 0x0990.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 37 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
3 files changed, 23 insertions, 18 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index abc03d3df..3a9297984 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -230,15 +230,15 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) msg.readUInt8("item type"); // uint8_t identified = msg.readUInt8(); // identify flag - msg.readInt32("location"); + const int equipType = msg.readInt32("location"); msg.readInt32("wear state"); const uint8_t refine = static_cast<uint8_t>(msg.readInt8("refine")); - msg.readInt16("cart0"); - msg.readInt16("cart1"); - msg.readInt16("cart2"); - msg.readInt16("cart3"); + msg.readInt16("card0"); + msg.readInt16("card1"); + msg.readInt16("card2"); + msg.readInt16("card3"); msg.readInt32("hire expire date (?)"); - const int equipType = msg.readInt16("equip type"); + msg.readInt16("equip type"); msg.readInt16("item sprite number"); msg.readInt8("flags"); @@ -268,16 +268,21 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) mEquips.clear(); PlayerInfo::getEquipment()->setBackend(&mEquips); } - const int index = msg.readInt16() - INVENTORY_OFFSET; - int amount = msg.readInt16(); - const int itemId = msg.readInt16(); - uint8_t identified = msg.readUInt8(); - msg.readUInt8(); // attribute - const uint8_t refine = msg.readUInt8(); - for (int i = 0; i < 4; i++) - msg.readInt16(); // cards[i] - const int equipType = msg.readInt16(); - msg.readUInt8(); // itemType + const int index = msg.readInt16("index") - INVENTORY_OFFSET; + int amount = msg.readInt16("count"); + const int itemId = msg.readInt16("item id"); + uint8_t identified = msg.readUInt8("identified"); + msg.readUInt8("is damaged"); + const uint8_t refine = msg.readUInt8("refine"); + msg.readInt16("card0"); + msg.readInt16("card1"); + msg.readInt16("card2"); + msg.readInt16("card3"); + const int equipType = msg.readInt32("location"); + msg.readUInt8("item type"); + msg.readUInt8("fail flag"); + msg.readInt32("hire expire date"); + msg.readInt16("equip type"); const ItemInfo &itemInfo = ItemDB::get(itemId); const unsigned char err = msg.readUInt8(); diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index a4e64a408..ac52ebc5f 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -248,7 +248,7 @@ int16_t packet_lengths[] = 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, 31, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x09C0 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 1a6d91d53..45c7e9592 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -69,7 +69,7 @@ #define SMSG_WHO_ANSWER 0x00c2 #define SMSG_PLAYER_WARP 0x0091 /**< Warp player to map/location */ #define SMSG_PLAYER_INVENTORY 0x01ee -#define SMSG_PLAYER_INVENTORY_ADD 0x00a0 +#define SMSG_PLAYER_INVENTORY_ADD 0x0990 #define SMSG_PLAYER_INVENTORY_REMOVE 0x00af #define SMSG_PLAYER_INVENTORY_USE 0x01c8 #define SMSG_PLAYER_EQUIPMENT 0x0992 |