From 7890bb3f423dbdb815d97f066594ae8917c5cee7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Sep 2014 23:21:54 +0300 Subject: eathena: move processPlayerUnEquip from ea namespace into eathena and tmwa. --- src/net/eathena/inventoryhandler.cpp | 14 ++++++++++++++ src/net/eathena/inventoryhandler.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index d0458a61b..da404fe05 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -411,4 +411,18 @@ void InventoryHandler::processPlayerEquip(Net::MessageIn &msg) BLOCK_END("InventoryHandler::processPlayerEquip") } +void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg) +{ + BLOCK_START("InventoryHandler::processPlayerUnEquip") + msg.readInt16(); // inder val - INVENTORY_OFFSET; + const int equipType = msg.readInt16(); + const uint8_t flag = msg.readUInt8(); + + if (flag) + mEquips.setEquipment(getSlot(equipType), -1); + if (equipType & 0x8000) + ArrowsListener::distributeEvent(); + BLOCK_END("InventoryHandler::processPlayerUnEquip") +} + } // namespace EAthena diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h index 7d1b9ddfc..78f35acbb 100644 --- a/src/net/eathena/inventoryhandler.h +++ b/src/net/eathena/inventoryhandler.h @@ -66,6 +66,8 @@ class InventoryHandler final : public MessageHandler, void processPlayerInventory(Net::MessageIn &msg); void processPlayerEquip(Net::MessageIn &msg); + + void processPlayerUnEquip(Net::MessageIn &msg); }; } // namespace EAthena -- cgit v1.2.3-70-g09d2