summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/npcdb.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 486f63952..7c983160c 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -80,14 +80,20 @@ void NPCDB::loadXmlFile(const std::string &fileName)
continue;
const int id = XML::getProperty(npcNode, "id", 0);
+ BeingInfo *currentInfo = nullptr;
if (id == 0)
{
logger->log("NPC Database: NPC with missing ID in %s!",
paths.getStringValue("npcsFile").c_str());
continue;
}
-
- BeingInfo *const currentInfo = new BeingInfo;
+ else if (mNPCInfos.find(id) != mNPCInfos.end())
+ {
+ logger->log("NpcDB: Redefinition of npc ID %d", id);
+ currentInfo = mNPCInfos[id];
+ }
+ if (!currentInfo)
+ currentInfo = new BeingInfo;
currentInfo->setTargetSelection(XML::getBoolProperty(npcNode,
"targetSelection", true));