summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-02 18:10:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-02 18:10:42 +0300
commit2127361148d4ea5531a115cc92131a3f956ca528 (patch)
tree668182e046ff19bbacdc8cfc326bc2fab224b62b /src/inventory.h
parentf89de74b1ac1cd9a02a70dab9221d601296da8cd (diff)
downloadplus-2127361148d4ea5531a115cc92131a3f956ca528.tar.gz
plus-2127361148d4ea5531a115cc92131a3f956ca528.tar.bz2
plus-2127361148d4ea5531a115cc92131a3f956ca528.tar.xz
plus-2127361148d4ea5531a115cc92131a3f956ca528.zip
Allow add items to npc inventory from same slot multiple times.
Added items automatically removed from inventory item amounts.
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 1d1f49ebe..995a8ef52 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -35,6 +35,8 @@
#include "enums/being/gender.h"
+#include "utils/intmap.h"
+
#include <list>
#include <string>
@@ -174,15 +176,20 @@ class Inventory final
int findIndexByTag(const int tag) const;
- void addVirtualItem(const Item *const item,
+ bool addVirtualItem(const Item *const item,
int index);
+ void virtualRemove(Item *const item,
+ const int amount);
+
+ void restoreVirtuals();
protected:
typedef std::list<InventoryListener*> InventoryListenerList;
InventoryListenerList mInventoryListeners;
void distributeSlotsChangedEvent();
+ IntMap mVirtualRemove;
InventoryType::Type mType;
unsigned mSize; /**< The max number of inventory items */
Item **mItems; /**< The holder of items */