diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-11 04:33:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-11 04:33:33 +0300 |
commit | c7836c6f0b693b7ed5b51b670ab95a4cf2201dba (patch) | |
tree | 77df506c5c5fd08aa730eaa539c0c304e01fee96 /src | |
parent | 6d75a0b710fd870a46d7e26096d35bb91c2a1e82 (diff) | |
download | plus-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.gz plus-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.bz2 plus-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.xz plus-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.zip |
Allow find in inventory items with color 0 and 1 as 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/inventory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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]; + } } } |