diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-04 19:06:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-04 19:35:23 +0300 |
commit | 2e752adf979e74f9a4b919bbc88929a7bf3adf25 (patch) | |
tree | cd8b5f370e0c86dc08a487a9721971da8bd491d8 /src/inventory.cpp | |
parent | e668ab141d6b006b790d2b0a8fc515d13b78317e (diff) | |
download | mv-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.cpp | 14 |
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) { |