summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 23:25:43 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 23:28:19 +0100
commit4f02ad59df9ee3314fb0d429a031ecbfa3206e3a (patch)
tree90b7afc312b7385061d25db753e8d1e500c83e69 /src/inventory.cpp
parentf67237cb69599753192c301f0f2eb38b88f7b57a (diff)
downloadMana-4f02ad59df9ee3314fb0d429a031ecbfa3206e3a.tar.gz
Mana-4f02ad59df9ee3314fb0d429a031ecbfa3206e3a.tar.bz2
Mana-4f02ad59df9ee3314fb0d429a031ecbfa3206e3a.tar.xz
Mana-4f02ad59df9ee3314fb0d429a031ecbfa3206e3a.zip
Moved the inventory and storage offset handling into netcode
No need to complicate the item containers and inventory classes with a silly offset used by the eAthena server. Also fixed the logToStandardOut option by reading it from the config after the configuration has been initialized.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 59f51e39..532d9ab6 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -37,9 +37,8 @@ struct SlotUsed : public std::unary_function<Item*, bool>
}
};
-Inventory::Inventory(int size, int offset):
- mSize(size),
- mOffset(offset)
+Inventory::Inventory(int size):
+ mSize(size)
{
mItems = new Item*[mSize];
std::fill_n(mItems, mSize, (Item*) 0);
@@ -135,7 +134,7 @@ bool Inventory::contains(Item *item) const
int Inventory::getFreeSlot() const
{
- Item **i = std::find_if(mItems + mOffset, mItems + mSize,
+ Item **i = std::find_if(mItems, mItems + mSize,
std::not1(SlotUsed()));
return (i == mItems + mSize) ? -1 : (i - mItems);
}
@@ -153,8 +152,3 @@ int Inventory::getLastUsedSlot() const
return -1;
}
-
-int Inventory::getInventorySize() const
-{
- return mSize - mOffset;
-}