diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-21 17:19:32 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-21 17:19:32 +0000 |
commit | 00b3b347f845f8b1550777f09464463af3805098 (patch) | |
tree | 7d0a4d5da82e71081efd0ad11b9b505964614778 | |
parent | 56fef6eed9e3145b5e7d33e066069f642873d7a1 (diff) | |
download | mana-00b3b347f845f8b1550777f09464463af3805098.tar.gz mana-00b3b347f845f8b1550777f09464463af3805098.tar.bz2 mana-00b3b347f845f8b1550777f09464463af3805098.tar.xz mana-00b3b347f845f8b1550777f09464463af3805098.zip |
maybe Hammerbear will like it this way?
-rw-r--r-- | src/resources/itemmanager.cpp | 5 | ||||
-rw-r--r-- | src/resources/itemmanager.h | 1 |
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 |