diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-22 16:43:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-22 16:43:39 +0300 |
commit | 448eabff4c29f31cfb74468857dcbf91a0c43df4 (patch) | |
tree | 2b30c9aa4b9c06398255323cb13ba41818dffe0a /src/net/eathena/inventoryhandler.cpp | |
parent | 08d9fbf5d4fb388bc186729a1174bf4aef0f8095 (diff) | |
download | manaplus-448eabff4c29f31cfb74468857dcbf91a0c43df4.tar.gz manaplus-448eabff4c29f31cfb74468857dcbf91a0c43df4.tar.bz2 manaplus-448eabff4c29f31cfb74468857dcbf91a0c43df4.tar.xz manaplus-448eabff4c29f31cfb74468857dcbf91a0c43df4.zip |
Impliment packet SMSG_BIND_ITEM.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r-- | src/net/eathena/inventoryhandler.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 0b3b12b5e..fd74ac11a 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -1293,9 +1293,23 @@ void InventoryHandler::processCartAddError(Net::MessageIn &msg) void InventoryHandler::processBindItem(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readInt16("item index"); + const int index = msg.readInt16("item index") - INVENTORY_OFFSET; + const Inventory *const inv = PlayerInfo::getInventory(); + if (inv) + { + std::string itemName; + const Item *item = inv->getItem(index); + if (item) + { + itemName = item->getName(); + } + else + { + // TRANSLATORS: unknown item message + itemName = _("Unknown item"); + } + NotifyManager::notify(NotifyTypes::BOUND_ITEM, itemName); + } } } // namespace EAthena |