summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-01 08:18:23 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-01 08:18:23 +0000
commit1a2dc3de03fee33e8d2a52767424498e2019321e (patch)
treebea722900f87fba80fdf4257c9d026ceca27a388 /src/inventory.cpp
parent15e4760a93edd430053cbad5d638b68593b61bc0 (diff)
downloadMana-1a2dc3de03fee33e8d2a52767424498e2019321e.tar.gz
Mana-1a2dc3de03fee33e8d2a52767424498e2019321e.tar.bz2
Mana-1a2dc3de03fee33e8d2a52767424498e2019321e.tar.xz
Mana-1a2dc3de03fee33e8d2a52767424498e2019321e.zip
Added code to dynamically adjust the itemcontainer size.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index c0ddd888..30763622 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -132,3 +132,16 @@ int Inventory::getNumberOfSlotsUsed()
return NumberOfFilledSlot;
}
+
+int Inventory::getLastUsedSlot()
+{
+ int i;
+
+ for (i = INVENTORY_SIZE - 1; i >= 0; i--) {
+ if ((items[i].getId() != -1) && (items[i].getQuantity() > 0)) {
+ break;
+ }
+ }
+
+ return --i;
+}