diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/inventory.cpp | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 3a2d3742..6cfcb921 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -23,12 +23,8 @@ #include "inventory.h" -#include "equipment.h" #include "item.h" -#include "net/messageout.h" -#include "net/protocol.h" - Inventory::Inventory() { items = new Item[INVENTORY_SIZE]; @@ -65,7 +61,7 @@ void Inventory::addItem(int index, int id, int quantity, bool equipment) } -void Inventory::resetItems() +void Inventory::clear() { for (int i = 0; i < INVENTORY_SIZE; i++) { items[i].setId(-1); @@ -95,44 +91,6 @@ bool Inventory::contains(Item *item) return false; } -int Inventory::useItem(Item *item) -{ - MessageOut outMsg; - outMsg.writeInt16(CMSG_PLAYER_INVENTORY_USE); - outMsg.writeInt16(item->getInvIndex()); - outMsg.writeInt32(item->getId()); - // Note: id is dest of item, usually player_node->account_ID ?? - return 0; -} - -int Inventory::dropItem(Item *item, int quantity) -{ - // TODO: Fix wrong coordinates of drops, serverside? - MessageOut outMsg; - outMsg.writeInt16(CMSG_PLAYER_INVENTORY_DROP); - outMsg.writeInt16(item->getInvIndex()); - outMsg.writeInt16(quantity); - return 0; -} - -void Inventory::equipItem(Item *item) -{ - MessageOut outMsg; - outMsg.writeInt16(CMSG_PLAYER_EQUIP); - outMsg.writeInt16(item->getInvIndex()); - outMsg.writeInt16(0); -} - -void Inventory::unequipItem(Item *item) -{ - MessageOut outMsg; - outMsg.writeInt16(CMSG_PLAYER_UNEQUIP); - outMsg.writeInt16(item->getInvIndex()); - - // Tidy equipment directly to avoid weapon still shown bug, by instance - Equipment::getInstance()->removeEquipment(item); -} - int Inventory::getFreeSlot() { for (int i = 2; i < INVENTORY_SIZE; i++) { |