summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-19 20:42:46 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-19 20:42:46 +0300
commit7191eefef8c7a02c7cf56f598ea76fe791328434 (patch)
treed45d89df864f4ea4906e764c0a825a7daf63e3e3 /src/inventory.cpp
parent05d7793aa71a600d76d169ca80744768b277c17b (diff)
downloadplus-7191eefef8c7a02c7cf56f598ea76fe791328434.tar.gz
plus-7191eefef8c7a02c7cf56f598ea76fe791328434.tar.bz2
plus-7191eefef8c7a02c7cf56f598ea76fe791328434.tar.xz
plus-7191eefef8c7a02c7cf56f598ea76fe791328434.zip
Fix adding items to trade.
Now possible add same items from all ways. Also added protection from adding same stackable items.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index acd35efdd..f907b2cc2 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -155,6 +155,9 @@ void Inventory::removeItemAt(int index)
bool Inventory::contains(Item *item) const
{
+ if (!item)
+ return false;
+
for (unsigned i = 0; i < mSize; i++)
{
if (mItems[i] && mItems[i]->getId() == item->getId())