diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-01 06:41:26 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-01 06:41:26 +0000 |
commit | 3b79ce4edf01b19a9ca0d1cb75ce38da8384b41d (patch) | |
tree | 4a4cb6b490acdb05d4d414c2493223a4a3845baa /src | |
parent | 3a3789a2c8cca53ece5ede1de9ee6d96707c76fc (diff) | |
download | mana-client-3b79ce4edf01b19a9ca0d1cb75ce38da8384b41d.tar.gz mana-client-3b79ce4edf01b19a9ca0d1cb75ce38da8384b41d.tar.bz2 mana-client-3b79ce4edf01b19a9ca0d1cb75ce38da8384b41d.tar.xz mana-client-3b79ce4edf01b19a9ca0d1cb75ce38da8384b41d.zip |
Fixed inventory display with respect to empty slots.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/itemcontainer.cpp | 2 | ||||
-rw-r--r-- | src/item.cpp | 7 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index e38b665f..c7ba2949 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -96,6 +96,8 @@ ItemContainer::draw(gcn::Graphics *graphics) if (!item) return; + if (item->getId() == 0) + continue; Image *image = item->getInfo().getImage(); if (image) { diff --git a/src/item.cpp b/src/item.cpp index 946181dc..66f638a5 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -24,16 +24,15 @@ #include "item.h" Item::Item(int id, int quantity) : - mId(id), mQuantity(quantity) { - // Either type or slot, both are unused anyway. -- silene - mEquipment = getInfo().getType(); + setId(id); } void Item::setId(int id) { mId = id; - mEquipment = getInfo().getType(); + // Types 0 and 1 are not equippable items. + mEquipment = id && getInfo().getType() >= 2; } diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 18952ae9..157e522c 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -171,7 +171,7 @@ void ItemDB::unload() const ItemInfo& ItemDB::get(int id) { - assert(mLoaded); + assert(mLoaded && id); ItemInfoIterator i = mItemInfos.find(id); |