summaryrefslogtreecommitdiff
path: root/src/net/ea/inventoryhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-12-07 14:16:26 -0700
committerJared Adams <jaxad0127@gmail.com>2009-12-07 14:16:26 -0700
commit4d9bbc8d2eea82fb4e60634b611d0058f74ebb82 (patch)
tree42ecc3776564cca78e99a9e562ab0b1009190fbe /src/net/ea/inventoryhandler.cpp
parent2f310b3040dcb56bd9ed1868dfa4f74b3fd00136 (diff)
downloadmana-4d9bbc8d2eea82fb4e60634b611d0058f74ebb82.tar.gz
mana-4d9bbc8d2eea82fb4e60634b611d0058f74ebb82.tar.bz2
mana-4d9bbc8d2eea82fb4e60634b611d0058f74ebb82.tar.xz
mana-4d9bbc8d2eea82fb4e60634b611d0058f74ebb82.zip
Fix bugs in eAthena's equipment handling
Do a bit of cleanup too.
Diffstat (limited to 'src/net/ea/inventoryhandler.cpp')
-rw-r--r--src/net/ea/inventoryhandler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index d7758321..faf0183a 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -341,7 +341,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
inventory->setItem(index, itemId, 1, true);
- mEquips.setEquipment(getSlot(equipType), index);
+ if (equipType)
+ {
+ mEquips.setEquipment(getSlot(equipType), index);
+ }
}
break;
@@ -370,7 +373,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
}
else
{
- mEquips.setEquipment(getSlot(equipType), 0);
+ mEquips.setEquipment(getSlot(equipType), -1);
}
break;
@@ -404,11 +407,8 @@ void InventoryHandler::equipItem(const Item *item)
void InventoryHandler::unequipItem(const Item *item)
{
- /*const Item *real_item = item->isInEquipment() ? getRealEquipedItem(item)
- : item;
-
- if (!real_item)
- return;*/
+ if (!item)
+ return;
MessageOut outMsg(CMSG_PLAYER_UNEQUIP);
outMsg.writeInt16(item->getInvIndex() + INVENTORY_OFFSET);