diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-01 08:18:23 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-01 08:18:23 +0000 |
commit | 1a2dc3de03fee33e8d2a52767424498e2019321e (patch) | |
tree | bea722900f87fba80fdf4257c9d026ceca27a388 /src/inventory.cpp | |
parent | 15e4760a93edd430053cbad5d638b68593b61bc0 (diff) | |
download | mana-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.cpp | 13 |
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; +} |