summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-11-28 21:49:25 -0700
committerFate <fate-tmw@googlemail.com>2008-11-28 21:49:25 -0700
commitb08958152524cb5c26bab8b8a9943f71acfbded3 (patch)
tree5de0b5e7cfaa1e7c4fc1351289e469d7e792565d /src/inventory.cpp
parent4aeedb10f22d0dc307c9f733d0f1c79b70b9c200 (diff)
downloadMana-b08958152524cb5c26bab8b8a9943f71acfbded3.tar.gz
Mana-b08958152524cb5c26bab8b8a9943f71acfbded3.tar.bz2
Mana-b08958152524cb5c26bab8b8a9943f71acfbded3.tar.xz
Mana-b08958152524cb5c26bab8b8a9943f71acfbded3.zip
Changed inventory container protocol to guarantee that we have no stale item references lying around
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 938d23d3..859213fe 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -50,7 +50,7 @@ Inventory::~Inventory()
Item* Inventory::getItem(int index) const
{
- if (index < 0 || index >= INVENTORY_SIZE)
+ if (index < 0 || index >= INVENTORY_SIZE || mItems[index]->getQuantity() <= 0)
return 0;
return mItems[index];