diff options
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) { |