summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemmanager.cpp5
-rw-r--r--src/resources/itemmanager.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp
index eb75321d..6453b55c 100644
--- a/src/resources/itemmanager.cpp
+++ b/src/resources/itemmanager.cpp
@@ -107,6 +107,9 @@ ItemManager::ItemManager()
} else {
logger.log("Error while parsing item database!");
}
+
+ unknown = new ItemInfo();
+ unknown->setName("Unknown item");
}
ItemManager::~ItemManager()
@@ -118,6 +121,6 @@ ItemInfo *ItemManager::getItemInfo(int id)
if (db.find(id) != db.end())
return db[id];
else
- return NULL;
+ return unknown;
}
diff --git a/src/resources/itemmanager.h b/src/resources/itemmanager.h
index b4c98e5b..8b8c437f 100644
--- a/src/resources/itemmanager.h
+++ b/src/resources/itemmanager.h
@@ -50,6 +50,7 @@ class ItemManager
protected:
// Items database
std::map <int, ItemInfo *> db;
+ ItemInfo *unknown;
};
#endif