summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-04 19:06:23 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-04 19:35:23 +0300
commit2e752adf979e74f9a4b919bbc88929a7bf3adf25 (patch)
treecd8b5f370e0c86dc08a487a9721971da8bd491d8 /src/inventory.cpp
parente668ab141d6b006b790d2b0a8fc515d13b78317e (diff)
downloadmv-2e752adf979e74f9a4b919bbc88929a7bf3adf25.tar.gz
mv-2e752adf979e74f9a4b919bbc88929a7bf3adf25.tar.bz2
mv-2e752adf979e74f9a4b919bbc88929a7bf3adf25.tar.xz
mv-2e752adf979e74f9a4b919bbc88929a7bf3adf25.zip
Add support for colors in outfits window.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 9c3e16666..6eb7dbf16 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -85,6 +85,20 @@ Item *Inventory::findItem(int itemId) const
return 0;
}
+Item *Inventory::findItem(int itemId, unsigned char color) const
+{
+ for (unsigned i = 0; i < mSize; i++)
+ {
+ if (mItems[i] && mItems[i]->getId() == itemId
+ && mItems[i]->getColor() == color)
+ {
+ return mItems[i];
+ }
+ }
+
+ return 0;
+}
+
void Inventory::addItem(int id, int quantity, int refine,
unsigned char color, bool equipment)
{