diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 532d9ab6..202c3e52 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -29,11 +29,7 @@ struct SlotUsed : public std::unary_function<Item*, bool> { bool operator()(const Item *item) const { -#ifdef TMWSERV_SUPPORT - return item && item->getId() && item->getQuantity(); -#else - return item && item->getId() != -1 && item->getQuantity() > 0; -#endif + return item && item->getId() >= 0 && item->getQuantity() > 0; } }; @@ -54,11 +50,7 @@ Inventory::~Inventory() Item *Inventory::getItem(int index) const { -#ifdef TMWSERV_SUPPORT - if (index < 0 || index >= mSize) -#else if (index < 0 || index >= mSize || !mItems[index] || mItems[index]->getQuantity() <= 0) -#endif return 0; return mItems[index]; @@ -91,6 +83,7 @@ void Inventory::setItem(int index, int id, int quantity, bool equipment) Item *item = new Item(id, quantity, equipment); item->setInvIndex(index); mItems[index] = item; + mItems[index]->setEquipment(equipment); } else if (id > 0) { |