summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/gui/itemcontainer.cpp2
-rw-r--r--src/item.cpp7
-rw-r--r--src/resources/itemdb.cpp2
4 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index db575fcb..cbc0ba93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-01 Guillaume Melquiond <guillaume.melquiond@gmail.com>
+
+ * src/item.cpp, src/gui/itemcontainer.cpp, src/resources/itemdb.cpp:
+ Fixed inventory display so that empty slots are not unknown items.
+ Adjusted "type" meaning to tmwserv one.
+
2007-09-25 Björn Steinbrink <B.Steinbrink@gmx.de>
* src/gui/browserbox.cpp: Fix wrapping of UTF-8 multi-byte characters.
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);