diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-07-21 20:19:25 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-07-21 20:21:55 -0600 |
commit | 4cc7305cfa08598398123641987cf1fdf2bd7616 (patch) | |
tree | cdf406f0c943201e98a9787fbe1a1f760bb0e22f /src/net/ea/inventoryhandler.cpp | |
parent | ce3d5a56de1309298603c9ce3b95659829f870ef (diff) | |
download | mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.gz mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.bz2 mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.xz mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.zip |
Merge equipment handling and fix some bugs
Diffstat (limited to 'src/net/ea/inventoryhandler.cpp')
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index ebea1883..112d8371 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -21,6 +21,7 @@ #include "net/ea/inventoryhandler.h" +#include "net/ea/equipmenthandler.h" #include "net/ea/protocol.h" #include "net/messagein.h" @@ -302,11 +303,13 @@ void InventoryHandler::equipItem(const Item *item) void InventoryHandler::unequipItem(const Item *item) { - if (!item) + const Item *real_item = item->isEquipped() ? item : getRealEquipedItem(item); + + if (!real_item) return; MessageOut outMsg(CMSG_PLAYER_UNEQUIP); - outMsg.writeInt16(item->getInvIndex() + INVENTORY_OFFSET); + outMsg.writeInt16(real_item->getInvIndex() + INVENTORY_OFFSET); } void InventoryHandler::useItem(const Item *item) |