From 9be90b76adb1518c4ffe0e365a18c5afcc3158f2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Dec 2014 01:27:45 +0300 Subject: Add item type to item object. --- src/inventory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index da15cbe42..89683d15c 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -104,6 +104,7 @@ Item *Inventory::findItem(const int itemId, const unsigned char color) const } int Inventory::addItem(const int id, + const int type, const int quantity, const uint8_t refine, const uint8_t color, @@ -114,13 +115,14 @@ int Inventory::addItem(const int id, const bool equipped) { const int slot = getFreeSlot(); - setItem(slot, id, quantity, refine, color, + setItem(slot, id, type, quantity, refine, color, identified, damaged, favorite, equipment, equipped); return slot; } void Inventory::setItem(const int index, const int id, + const int type, const int quantity, const uint8_t refine, const unsigned char color, @@ -139,7 +141,7 @@ void Inventory::setItem(const int index, Item *const item1 = mItems[index]; if (!item1 && id > 0) { - Item *const item = new Item(id, quantity, refine, color, + Item *const item = new Item(id, type, quantity, refine, color, identified, damaged, favorite, equipment, equipped); item->setInvIndex(index); mItems[index] = item; -- cgit v1.2.3-70-g09d2