diff options
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 616eb0f5..1de08b57 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -216,3 +216,18 @@ void ItemContainer::setEquipment(int index, bool equipment) { items[index].equipment = equipment; } + +int ItemContainer::getNumberOfSlotsUsed() +{ + int NumberOfFilledSlot = 0; + for (int i = 0; i < INVENTORY_SIZE; i++) + { + if (items[i].quantity > 0) + { + NumberOfFilledSlot++; + } + } + + return NumberOfFilledSlot; +} + |