summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-11 04:33:33 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-11 04:33:33 +0300
commitc7836c6f0b693b7ed5b51b670ab95a4cf2201dba (patch)
tree77df506c5c5fd08aa730eaa539c0c304e01fee96 /src
parent6d75a0b710fd870a46d7e26096d35bb91c2a1e82 (diff)
downloadmv-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.gz
mv-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.bz2
mv-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.tar.xz
mv-c7836c6f0b693b7ed5b51b670ab95a4cf2201dba.zip
Allow find in inventory items with color 0 and 1 as 1.
Diffstat (limited to 'src')
-rw-r--r--src/inventory.cpp9
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];
+ }
}
}