summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcuoco <cuoco@themanaworld.org>2023-05-15 13:58:53 +0200
committercuoco <cuoco@themanaworld.org>2023-05-15 13:58:53 +0200
commit8102cdca12500c19cd9bf142d04d12285ad21abf (patch)
treea4e32d3bc6a96598641cb771e98f9a8938b3dfd5
parent3c960310317d589ec81ef4ac0aa334a495ac50fc (diff)
downloadplus-8102cdca12500c19cd9bf142d04d12285ad21abf.tar.gz
plus-8102cdca12500c19cd9bf142d04d12285ad21abf.tar.bz2
plus-8102cdca12500c19cd9bf142d04d12285ad21abf.tar.xz
plus-8102cdca12500c19cd9bf142d04d12285ad21abf.zip
condition is false at the beginning so the body didnt executeHEADmaster
-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--)