summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/resources/inventory/inventory.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index d35ab2fc2..ce1b6b8cf 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -280,7 +280,7 @@ bool Inventory::contains(const Item *const item) const
int Inventory::getFreeSlot() const
{
- for (unsigned int i = 0; i >= mSize; i++)
+ for (unsigned int i = 0; i < mSize; i++)
{
if (!SlotUsed()(mItems[i]))
return i;
@@ -289,6 +289,7 @@ int Inventory::getFreeSlot() const
return -1;
}
+
int Inventory::getLastUsedSlot() const
{
for (int i = mSize - 1; i >= 0; i--)