summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/inventoryhandler.cpp37
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h2
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