summaryrefslogtreecommitdiff
path: root/src/resources/db/emotedb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db/emotedb.cpp')
-rw-r--r--src/resources/db/emotedb.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp
index 907bb75c4..7c710795f 100644
--- a/src/resources/db/emotedb.cpp
+++ b/src/resources/db/emotedb.cpp
@@ -100,8 +100,11 @@ void EmoteDB::loadXmlFile(const std::string &fileName)
paths.getStringValue("emotesFile").c_str());
continue;
}
-
- EmoteInfo *const currentInfo = new EmoteInfo;
+ EmoteInfo *currentInfo = nullptr;
+ if (mEmoteInfos.find(id) != mEmoteInfos.end())
+ currentInfo = mEmoteInfos[id];
+ else
+ currentInfo = new EmoteInfo;
currentInfo->time = XML::getProperty(emoteNode, "time", 500);
for_each_xml_child_node(spriteNode, emoteNode)
@@ -169,7 +172,11 @@ void EmoteDB::loadSpecialXmlFile(const std::string &fileName)
}
const int altId = XML::getProperty(emoteNode, "altid", -1);
- EmoteInfo *const currentInfo = new EmoteInfo;
+ EmoteInfo *currentInfo = nullptr;
+ if (mEmoteInfos.find(id) != mEmoteInfos.end())
+ currentInfo = mEmoteInfos[id];
+ if (!currentInfo)
+ currentInfo = new EmoteInfo;
currentInfo->time = XML::getProperty(emoteNode, "time", 500);
for_each_xml_child_node(spriteNode, emoteNode)