From 7191eefef8c7a02c7cf56f598ea76fe791328434 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Aug 2011 20:42:46 +0300 Subject: Fix adding items to trade. Now possible add same items from all ways. Also added protection from adding same stackable items. --- src/inventory.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/inventory.cpp') 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()) -- cgit v1.2.3-70-g09d2