summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-03 02:50:03 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-03 02:50:03 +0200
commitde51eaa43e05c2126fc1eef2a7e115843f972547 (patch)
tree286a05a069e048247f90c7595f1b8939be784608 /src/inventory.cpp
parentd4c08d3bf69410a35a50875de50cc6fe74b3bf3e (diff)
parent8627c7745f47492ab349da6a74e98e3d5813418f (diff)
downloadmanaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.gz
manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.bz2
manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.xz
manaplus-de51eaa43e05c2126fc1eef2a7e115843f972547.zip
Merge branch 'coloritems'
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 04a8a8962..705ae9329 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -83,13 +83,14 @@ Item *Inventory::findItem(int itemId) const
return 0;
}
-void Inventory::addItem(int id, int quantity, int refine, bool equipment)
+void Inventory::addItem(int id, int quantity, int refine,
+ unsigned char color, bool equipment)
{
- setItem(getFreeSlot(), id, quantity, refine, equipment);
+ setItem(getFreeSlot(), id, quantity, refine, color, equipment);
}
void Inventory::setItem(int index, int id, int quantity,
- int refine, bool equipment)
+ int refine, unsigned char color, bool equipment)
{
if (index < 0 || index >= static_cast<int>(mSize))
{
@@ -99,7 +100,7 @@ void Inventory::setItem(int index, int id, int quantity,
if (!mItems[index] && id > 0)
{
- Item *item = new Item(id, quantity, refine, equipment);
+ Item *item = new Item(id, quantity, refine, color, equipment);
item->setInvIndex(index);
mItems[index] = item;
mUsed++;
@@ -107,7 +108,7 @@ void Inventory::setItem(int index, int id, int quantity,
}
else if (id > 0 && mItems[index])
{
- mItems[index]->setId(id);
+ mItems[index]->setId(id, color);
mItems[index]->setQuantity(quantity);
mItems[index]->setRefine(refine);
mItems[index]->setEquipment(equipment);