summaryrefslogtreecommitdiff
path: root/src/resources/itemmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/itemmanager.cpp')
-rw-r--r--src/resources/itemmanager.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp
index a497b3c8..7d0b13f2 100644
--- a/src/resources/itemmanager.cpp
+++ b/src/resources/itemmanager.cpp
@@ -41,8 +41,7 @@
ItemManager::ItemManager()
{
- mUnknown = new ItemInfo();
- mUnknown->setName("Unknown item");
+ mUnknown.setName("Unknown item");
ResourceManager *resman = ResourceManager::getInstance();
int size;
@@ -163,14 +162,12 @@ ItemManager::~ItemManager()
delete i->second;
}
mItemInfos.clear();
-
- delete mUnknown;
}
-ItemInfo*
+const ItemInfo&
ItemManager::getItemInfo(int id)
{
ItemInfoIterator i = mItemInfos.find(id);
- return (i != mItemInfos.end()) ? i->second : mUnknown;
+ return (i != mItemInfos.end()) ? *(i->second) : mUnknown;
}