From 7bdb50605562e47f1d6ae134881c09bd42293be5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 16:19:21 +0300 Subject: Add strong typed int type BeingTypeId. --- src/resources/db/monsterdb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/resources/db/monsterdb.cpp') diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp index de72f487f..2e2256b58 100644 --- a/src/resources/db/monsterdb.cpp +++ b/src/resources/db/monsterdb.cpp @@ -88,11 +88,11 @@ void MonsterDB::loadXmlFile(const std::string &fileName) const int id = XML::getProperty(monsterNode, "id", 0); BeingInfo *currentInfo = nullptr; - if (mMonsterInfos.find(fromInt(id + offset, BeingId)) + if (mMonsterInfos.find(fromInt(id + offset, BeingTypeId)) != mMonsterInfos.end()) { logger->log("MonsterDB: Redefinition of monster ID %d", id); - currentInfo = mMonsterInfos[fromInt(id + offset, BeingId)]; + currentInfo = mMonsterInfos[fromInt(id + offset, BeingTypeId)]; } if (!currentInfo) currentInfo = new BeingInfo; @@ -140,7 +140,7 @@ void MonsterDB::loadXmlFile(const std::string &fileName) } currentInfo->setDisplay(display); - mMonsterInfos[fromInt(id + offset, BeingId)] = currentInfo; + mMonsterInfos[fromInt(id + offset, BeingTypeId)] = currentInfo; } } @@ -153,14 +153,14 @@ void MonsterDB::unload() } -BeingInfo *MonsterDB::get(const BeingId id) +BeingInfo *MonsterDB::get(const BeingTypeId id) { BeingInfoIterator i = mMonsterInfos.find(id); if (i == mMonsterInfos.end()) { i = mMonsterInfos.find(fromInt(toInt( - id, int) + OLD_TMWATHENA_OFFSET, BeingId)); + id, int) + OLD_TMWATHENA_OFFSET, BeingTypeId)); if (i == mMonsterInfos.end()) { logger->log("MonsterDB: Warning, unknown monster ID %d requested", -- cgit v1.2.3-70-g09d2