summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-01 16:54:24 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:54 +0300
commita0ef056695ad6632cb7c0de13320f65847d2c88a (patch)
treec13e1331e4b2bedf8f067eec8993b43d08f3b6b4 /src/net/eathena
parent11d80e856811ceddec805ce68b0a17b13f5cf25e (diff)
downloadplus-a0ef056695ad6632cb7c0de13320f65847d2c88a.tar.gz
plus-a0ef056695ad6632cb7c0de13320f65847d2c88a.tar.bz2
plus-a0ef056695ad6632cb7c0de13320f65847d2c88a.tar.xz
plus-a0ef056695ad6632cb7c0de13320f65847d2c88a.zip
eathena: add missing fields in processPlayerEquipment.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/inventoryhandler.cpp40
-rw-r--r--src/net/eathena/packets.h2
2 files changed, 22 insertions, 20 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 3bdedcb8f..b1b787911 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -210,34 +210,36 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
Inventory *const inventory = localPlayer
? PlayerInfo::getInventory() : nullptr;
- msg.readInt16(); // length
+ msg.readInt16("len");
Equipment *const equipment = PlayerInfo::getEquipment();
if (equipment && !equipment->getBackend())
{ // look like SMSG_PLAYER_INVENTORY was not received
mEquips.clear();
equipment->setBackend(&mEquips);
}
- const int number = (msg.getLength() - 4) / 20;
+ const int number = (msg.getLength() - 4) / 31;
for (int loop = 0; loop < number; loop++)
{
- const int index = msg.readInt16() - INVENTORY_OFFSET;
- const int itemId = msg.readInt16();
- const uint8_t itemType = msg.readUInt8(); // type
- uint8_t identified = msg.readUInt8(); // identify flag
-
- msg.readInt16(); // equip type
- const int equipType = msg.readInt16();
- msg.readUInt8(); // attribute
- const uint8_t refine = msg.readUInt8();
- msg.skip(8); // card
-
- if (mDebugInventory)
- {
- logger->log("Index: %d, ID: %d, Type: %d, Identified: %d",
- index, itemId, itemType, identified);
- }
-
+ const int index = msg.readInt16("index") - INVENTORY_OFFSET;
+ const int itemId = msg.readInt16("item id");
+ const uint8_t itemType = msg.readUInt8("item type");
+// uint8_t identified = msg.readUInt8(); // identify flag
+
+ 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.readInt32("hire expire date (?)");
+ const int equipType = msg.readInt16("equip type");
+ msg.readInt16("item sprite number");
+ const uint8_t flags = static_cast<uint8_t>(msg.readInt8("flags"));
+
+ // need get actual identify flag
+ uint8_t identified = 1;
if (inventory)
{
inventory->setItem(index, itemId, 1, refine,
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index fe151d447..5958fb9a2 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, 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, 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, 0,
// #0x09C0