From c7836c6f0b693b7ed5b51b670ab95a4cf2201dba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Jun 2011 04:33:33 +0300 Subject: Allow find in inventory items with color 0 and 1 as 1. --- src/inventory.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/inventory.cpp b/src/inventory.cpp index 894377884..3ff40374a 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -78,10 +78,13 @@ Item *Inventory::findItem(int itemId, unsigned char color) const { for (unsigned i = 0; i < mSize; i++) { - if (mItems[i] && mItems[i]->getId() == itemId - && (color == 0 || mItems[i]->getColor() == color)) + if (mItems[i] && mItems[i]->getId() == itemId) { - return mItems[i]; + if (color == 0 || mItems[i]->getColor() == color + || (color == 1 && mItems[i]->getColor() <= 1)) + { + return mItems[i]; + } } } -- cgit v1.2.3-70-g09d2