summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-23 01:27:45 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-23 01:27:45 +0300
commit9be90b76adb1518c4ffe0e365a18c5afcc3158f2 (patch)
treebbfea959321e05c329f18ac37757be91f38b9df8 /src/inventory.cpp
parent7f1053c5ce9e80485730290d002f7ae25db83996 (diff)
downloadplus-9be90b76adb1518c4ffe0e365a18c5afcc3158f2.tar.gz
plus-9be90b76adb1518c4ffe0e365a18c5afcc3158f2.tar.bz2
plus-9be90b76adb1518c4ffe0e365a18c5afcc3158f2.tar.xz
plus-9be90b76adb1518c4ffe0e365a18c5afcc3158f2.zip
Add item type to item object.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp6
1 files changed, 4 insertions, 2 deletions
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;