diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index a6038c85..245306ae 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "event.h" #include "inventory.h" #include "item.h" #include "log.h" @@ -36,7 +37,7 @@ struct SlotUsed : public std::unary_function<Item*, bool> } }; -Inventory::Inventory(int type, int size): +Inventory::Inventory(Type type, int size): mType(type), mSize(size == -1 ? Net::getInventoryHandler()->getSize(type) : size), mUsed(0) @@ -70,12 +71,12 @@ Item *Inventory::findItem(int itemId) const return NULL; } -void Inventory::addItem(int id, int quantity, bool equipment) +void Inventory::addItem(int id, int quantity) { - setItem(getFreeSlot(), id, quantity, equipment); + setItem(getFreeSlot(), id, quantity); } -void Inventory::setItem(int index, int id, int quantity, bool equipment) +void Inventory::setItem(int index, int id, int quantity) { if (index < 0 || index >= mSize) { @@ -85,7 +86,7 @@ void Inventory::setItem(int index, int id, int quantity, bool equipment) if (!mItems[index] && id > 0) { - Item *item = new Item(id, quantity, equipment); + Item *item = new Item(id, quantity); item->setInvIndex(index); mItems[index] = item; mUsed++; @@ -95,7 +96,6 @@ void Inventory::setItem(int index, int id, int quantity, bool equipment) { mItems[index]->setId(id); mItems[index]->setQuantity(quantity); - mItems[index]->setEquipment(equipment); } else if (mItems[index]) { |