summaryrefslogtreecommitdiff
path: root/src/resources/db/homunculusdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db/homunculusdb.cpp')
-rw-r--r--src/resources/db/homunculusdb.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp
index 173b37e65..41c863a6f 100644
--- a/src/resources/db/homunculusdb.cpp
+++ b/src/resources/db/homunculusdb.cpp
@@ -85,10 +85,11 @@ void HomunculusDB::loadXmlFile(const std::string &fileName)
const int id = XML::getProperty(homunculusNode, "id", 0);
BeingInfo *currentInfo = nullptr;
- if (mHomunculusInfos.find(id + offset) != mHomunculusInfos.end())
+ if (mHomunculusInfos.find(fromInt(id + offset, BeingId))
+ != mHomunculusInfos.end())
{
logger->log("HomunculusDB: Redefinition of homunculus ID %d", id);
- currentInfo = mHomunculusInfos[id + offset];
+ currentInfo = mHomunculusInfos[fromInt(id + offset, BeingId)];
}
if (!currentInfo)
currentInfo = new BeingInfo;
@@ -133,7 +134,7 @@ void HomunculusDB::loadXmlFile(const std::string &fileName)
}
currentInfo->setDisplay(display);
- mHomunculusInfos[id + offset] = currentInfo;
+ mHomunculusInfos[fromInt(id + offset, BeingId)] = currentInfo;
}
}
@@ -146,7 +147,7 @@ void HomunculusDB::unload()
}
-BeingInfo *HomunculusDB::get(const int id)
+BeingInfo *HomunculusDB::get(const BeingId id)
{
BeingInfoIterator i = mHomunculusInfos.find(id);
@@ -157,7 +158,7 @@ BeingInfo *HomunculusDB::get(const int id)
{
logger->log("HomunculusDB: Warning, unknown homunculus ID "
"%d requested",
- id);
+ toInt(id, int));
return BeingInfo::unknown;
}
else