From e3ad003fe09ff90524ffa5deae844e6721b903b2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Oct 2014 17:43:19 +0300 Subject: Set cards from net code. --- src/inventory.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/inventory.cpp') 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, -- cgit v1.2.3-60-g2f50