From 8745368108563d7c32820b989c3ea794ccb834f9 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 25 Mar 2010 16:03:13 -0600 Subject: Remove the type boolean from InventoryWindow This moves inventory/storage type into the Inventory class, having size default to a call to the netcode to get the sive for the given type. Reviewed-by: Chuck Miller --- src/inventory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/inventory.cpp') 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 struct SlotUsed : public std::unary_function @@ -33,8 +36,9 @@ struct SlotUsed : public std::unary_function } }; -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]; -- cgit v1.2.3-70-g09d2