diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-29 18:33:44 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-29 18:33:44 +0200 |
commit | 9587fb9b86ee4081ba14d23c1133bf1a09ee4578 (patch) | |
tree | 7682df3ec17534be553caae85ffa9e5a68c9a815 /src/inventory.cpp | |
parent | 63b41440a0555c6b39141eab94ef4627f712b476 (diff) | |
parent | 8748f26234bba1e71bbe059147fb02256f8cec2a (diff) | |
download | mana-client-9587fb9b86ee4081ba14d23c1133bf1a09ee4578.tar.gz mana-client-9587fb9b86ee4081ba14d23c1133bf1a09ee4578.tar.bz2 mana-client-9587fb9b86ee4081ba14d23c1133bf1a09ee4578.tar.xz mana-client-9587fb9b86ee4081ba14d23c1133bf1a09ee4578.zip |
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 12 |
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; -} |