diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-07-22 12:05:34 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-07-22 12:05:34 -0600 |
commit | f8b463d9fdd249f06ff48c128d17c83637e010dd (patch) | |
tree | 7036026d31a5ae30d584487794ed0f6409d4cc11 /src/net | |
parent | 95fc361288426b819338f1743e67e05c7882fc73 (diff) | |
download | mana-f8b463d9fdd249f06ff48c128d17c83637e010dd.tar.gz mana-f8b463d9fdd249f06ff48c128d17c83637e010dd.tar.bz2 mana-f8b463d9fdd249f06ff48c128d17c83637e010dd.tar.xz mana-f8b463d9fdd249f06ff48c128d17c83637e010dd.zip |
Fix bug with clearing inventory on map warp
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/equipmenthandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/equipmenthandler.h | 1 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/net/ea/equipmenthandler.cpp b/src/net/ea/equipmenthandler.cpp index 0b6c5753..3520bca5 100644 --- a/src/net/ea/equipmenthandler.cpp +++ b/src/net/ea/equipmenthandler.cpp @@ -113,6 +113,20 @@ void setEquipment(int eAthenaSlot, int index, bool equiped) } } +void clearEquipment() +{ + for (int i = 0; i < Equipment::EQUIP_VECTOREND; i++) + { + if (equips[i]) + { + equips[i]->setEquipped(false); + player_node->mEquipment->setEquipment(i, -1); + } + + equips[i] = NULL; + } +} + Item *getRealEquipedItem(const Item *equipped) { if (!equipped) diff --git a/src/net/ea/equipmenthandler.h b/src/net/ea/equipmenthandler.h index 5239c486..47c2f803 100644 --- a/src/net/ea/equipmenthandler.h +++ b/src/net/ea/equipmenthandler.h @@ -29,6 +29,7 @@ class Item; namespace EAthena { void setEquipment(int eAthenaSlot, int index, bool equiped); +void clearEquipment(); Item *getRealEquipedItem(const Item *equipped); class EquipmentHandler : public MessageHandler diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 172e3e95..6ee974fc 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -87,6 +87,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) if (msg.getId() == SMSG_PLAYER_INVENTORY) { // Clear inventory - this will be a complete refresh + clearEquipment(); inventory->clear(); } else |