diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-02 18:10:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-02 18:10:42 +0300 |
commit | 2127361148d4ea5531a115cc92131a3f956ca528 (patch) | |
tree | 668182e046ff19bbacdc8cfc326bc2fab224b62b /src/inventory.h | |
parent | f89de74b1ac1cd9a02a70dab9221d601296da8cd (diff) | |
download | mv-2127361148d4ea5531a115cc92131a3f956ca528.tar.gz mv-2127361148d4ea5531a115cc92131a3f956ca528.tar.bz2 mv-2127361148d4ea5531a115cc92131a3f956ca528.tar.xz mv-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.h | 9 |
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 */ |