summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-21 17:43:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-21 17:43:19 +0300
commite3ad003fe09ff90524ffa5deae844e6721b903b2 (patch)
tree756f8cae3ee12060548384ece6750a25bee4ab45 /src/inventory.cpp
parent4ab7d38fe9033695e23042e97b55999b26f00fd7 (diff)
downloadplus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.gz
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.bz2
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.tar.xz
plus-e3ad003fe09ff90524ffa5deae844e6721b903b2.zip
Set cards from net code.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 0a76dff7d..da15cbe42 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -103,18 +103,20 @@ Item *Inventory::findItem(const int itemId, const unsigned char color) const
return nullptr;
}
-void Inventory::addItem(const int id,
- const int quantity,
- const uint8_t refine,
- const uint8_t color,
- const bool identified,
- const bool damaged,
- const bool favorite,
- const bool equipment,
- const bool equipped)
+int Inventory::addItem(const int id,
+ const int quantity,
+ const uint8_t refine,
+ const uint8_t color,
+ const bool identified,
+ const bool damaged,
+ const bool favorite,
+ const bool equipment,
+ const bool equipped)
{
- setItem(getFreeSlot(), id, quantity, refine, color,
+ const int slot = getFreeSlot();
+ setItem(slot, id, quantity, refine, color,
identified, damaged, favorite, equipment, equipped);
+ return slot;
}
void Inventory::setItem(const int index,