diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 8a6e79bb..a6038c85 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -23,6 +23,9 @@ #include "item.h" #include "log.h" +#include "net/inventoryhandler.h" +#include "net/net.h" + #include <algorithm> struct SlotUsed : public std::unary_function<Item*, bool> @@ -33,8 +36,9 @@ struct SlotUsed : public std::unary_function<Item*, bool> } }; -Inventory::Inventory(int size): - mSize(size), +Inventory::Inventory(int type, int size): + mType(type), + mSize(size == -1 ? Net::getInventoryHandler()->getSize(type) : size), mUsed(0) { mItems = new Item*[mSize]; |