summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-23 22:02:17 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-23 22:02:17 +0200
commit768f3d93019b262ce6aa9f913aed0f45d5e4c929 (patch)
tree0eee9d83a498b1f18def288848f54551881b778d /src/resources/itemdb.cpp
parentcc2cd67e1c3c3f95485ae4477b6a2f0d255e9163 (diff)
parentfbbd4c406bf95ef8591f7368baacfad6f4d3f30f (diff)
downloadmana-768f3d93019b262ce6aa9f913aed0f45d5e4c929.tar.gz
mana-768f3d93019b262ce6aa9f913aed0f45d5e4c929.tar.bz2
mana-768f3d93019b262ce6aa9f913aed0f45d5e4c929.tar.xz
mana-768f3d93019b262ce6aa9f913aed0f45d5e4c929.zip
Merge branch '0.0.29'
Conflicts: src/gui/widgets/chattab.cpp
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r--src/resources/itemdb.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 899dd977..62bf0700 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -247,7 +247,7 @@ void ItemDB::unload()
mLoaded = false;
}
-const ItemInfo& ItemDB::get(int id)
+const ItemInfo &ItemDB::get(int id)
{
assert(mLoaded);
@@ -255,30 +255,30 @@ const ItemInfo& ItemDB::get(int id)
if (i == mItemInfos.end())
{
- logger->log("ItemDB: Error, unknown item ID# %d", id);
+ logger->log("ItemDB: Warning, unknown item ID# %d", id);
return *mUnknown;
}
- else
- {
- return *(i->second);
- }
+
+ return *(i->second);
}
-const ItemInfo& ItemDB::get(const std::string &name)
+const ItemInfo &ItemDB::get(const std::string &name)
{
- assert(mLoaded && !name.empty());
+ assert(mLoaded);
NamedItemInfos::const_iterator i = mNamedItemInfos.find(name);
if (i == mNamedItemInfos.end())
{
- logger->log("ItemDB: Error, unknown item name %s", name.c_str());
+ if (!name.empty())
+ {
+ logger->log("ItemDB: Warning, unknown item name \"%s\"",
+ name.c_str());
+ }
return *mUnknown;
}
- else
- {
- return *(i->second);
- }
+
+ return *(i->second);
}
void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node)