summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-31 21:29:00 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-31 21:29:00 +0000
commit36d28236321b6a2824ad4f394faeabbf79626808 (patch)
tree7d2475acf84852f2a21cc29eecbf7524cd58ff52 /src/inventory.cpp
parentc9f930c759004e179545c3b82992e3f8a12345f2 (diff)
downloadmana-36d28236321b6a2824ad4f394faeabbf79626808.tar.gz
mana-36d28236321b6a2824ad4f394faeabbf79626808.tar.bz2
mana-36d28236321b6a2824ad4f394faeabbf79626808.tar.xz
mana-36d28236321b6a2824ad4f394faeabbf79626808.zip
Removed legacy inventory code. Added display of equipment.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index ac0bce18..11c52421 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -49,7 +49,7 @@ Inventory::~Inventory()
Item* Inventory::getItem(int index)
{
- if (index < 0 || index > INVENTORY_SIZE)
+ if (index < 0 || index >= INVENTORY_SIZE)
{
return 0;
}
@@ -57,16 +57,15 @@ Item* Inventory::getItem(int index)
return &mItems[index];
}
-void Inventory::addItem(int id, int quantity, bool equipment)
+void Inventory::addItem(int id, int quantity)
{
- addItem(getFreeSlot(), id, quantity, equipment);
+ addItem(getFreeSlot(), id, quantity);
}
-void Inventory::addItem(int index, int id, int quantity, bool equipment)
+void Inventory::addItem(int index, int id, int quantity)
{
mItems[index].setId(id);
mItems[index].increaseQuantity(quantity);
- mItems[index].setEquipment(equipment);
}
@@ -75,7 +74,6 @@ void Inventory::clear()
for (int i = 0; i < INVENTORY_SIZE; i++) {
mItems[i].setId(-1);
mItems[i].setQuantity(0);
- mItems[i].setEquipped(false);
}
}
@@ -85,7 +83,6 @@ void Inventory::removeItem(int id)
if (mItems[i].getId() == id) {
mItems[i].setId(-1);
mItems[i].setQuantity(0);
- mItems[i].setEquipped(false);
}
}
}