From a0ef056695ad6632cb7c0de13320f65847d2c88a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Sep 2014 16:54:24 +0300 Subject: eathena: add missing fields in processPlayerEquipment. --- src/net/eathena/inventoryhandler.cpp | 40 +++++++++++++++++++----------------- src/net/eathena/packets.h | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) (limited to 'src/net/eathena') 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(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(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 -- cgit v1.2.3-70-g09d2