diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 03:21:05 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 03:21:05 +0000 |
commit | 8f375a38ad972a1fcac7953cc0d254313c88b7c9 (patch) | |
tree | 7283b64fba5b6898f2c25131cd996f279e7bb302 /src/gui | |
parent | b8a237ac0d5063ce43b462af22da92e8c817f4d3 (diff) | |
download | mana-client-8f375a38ad972a1fcac7953cc0d254313c88b7c9.tar.gz mana-client-8f375a38ad972a1fcac7953cc0d254313c88b7c9.tar.bz2 mana-client-8f375a38ad972a1fcac7953cc0d254313c88b7c9.tar.xz mana-client-8f375a38ad972a1fcac7953cc0d254313c88b7c9.zip |
Made Inventory use STL algorithms and fixed getLastUsedSlot semantics.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemcontainer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 0cdb8864..67cb5251 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -49,7 +49,7 @@ ItemContainer::ItemContainer(Inventory *inventory): if (!selImg) logger->error("Unable to load selection.png"); selectedItem = 0; // No item selected - maxItems = mInventory->getLastUsedSlot(); + maxItems = mInventory->getLastUsedSlot() - 1; // Count from 0, usage from 2 addMouseListener(this); } @@ -64,7 +64,7 @@ void ItemContainer::logic() { gcn::Widget::logic(); - int i = mInventory->getLastUsedSlot(); + int i = mInventory->getLastUsedSlot() - 1; // Count from 0, usage from 2 if (i != maxItems) { maxItems = i; |