From 9049b5a8d88f864a99df228df0152adabef4d909 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Sep 2014 23:12:01 +0300 Subject: Move processPlayerEquip from ea namespace into tmwa and eathena. --- src/net/eathena/inventoryhandler.cpp | 18 ++++++++++++++++++ src/net/eathena/inventoryhandler.h | 2 ++ 2 files changed, 20 insertions(+) (limited to 'src/net/eathena') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 3eb10d28b..3861945df 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -22,6 +22,8 @@ #include "net/eathena/inventoryhandler.h" +#include "notifymanager.h" + #include "being/localplayer.h" #include "being/pickup.h" @@ -32,6 +34,8 @@ #include "net/ea/eaprotocol.h" +#include "resources/notifytypes.h" + #include "debug.h" extern Net::InventoryHandler *inventoryHandler; @@ -392,4 +396,18 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg) BLOCK_END("InventoryHandler::processPlayerInventory") } +void InventoryHandler::processPlayerEquip(Net::MessageIn &msg) +{ + BLOCK_START("InventoryHandler::processPlayerEquip") + const int index = msg.readInt16() - INVENTORY_OFFSET; + const int equipType = msg.readInt16(); + const uint8_t flag = msg.readUInt8(); + + if (!flag) + NotifyManager::notify(NotifyTypes::EQUIP_FAILED); + else + mEquips.setEquipment(getSlot(equipType), index); + BLOCK_END("InventoryHandler::processPlayerEquip") +} + } // namespace EAthena diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h index 00e9a3044..7d1b9ddfc 100644 --- a/src/net/eathena/inventoryhandler.h +++ b/src/net/eathena/inventoryhandler.h @@ -64,6 +64,8 @@ class InventoryHandler final : public MessageHandler, void processPlayerInventoryAdd(Net::MessageIn &msg); void processPlayerInventory(Net::MessageIn &msg); + + void processPlayerEquip(Net::MessageIn &msg); }; } // namespace EAthena -- cgit v1.2.3-70-g09d2