diff options
author | Fate <fate-tmw@googlemail.com> | 2008-11-28 21:49:25 -0700 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2008-11-28 21:49:25 -0700 |
commit | b08958152524cb5c26bab8b8a9943f71acfbded3 (patch) | |
tree | 5de0b5e7cfaa1e7c4fc1351289e469d7e792565d /src/inventory.cpp | |
parent | 4aeedb10f22d0dc307c9f733d0f1c79b70b9c200 (diff) | |
download | mana-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.cpp | 2 |
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]; |