From 2e752adf979e74f9a4b919bbc88929a7bf3adf25 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Jun 2011 19:06:23 +0300 Subject: Add support for colors in outfits window. --- src/inventory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/inventory.cpp') 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) { -- cgit v1.2.3-60-g2f50