summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/resources/monsterdb.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index f4987afb0..a7976b97d 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -124,11 +124,11 @@ void MonsterDB::load()
//iterate <sprite>s and <sound>s
for_each_xml_child_node(spriteNode, monsterNode)
{
- if (!spriteNode->xmlChildrenNode)
- continue;
-
if (xmlNameEqual(spriteNode, "sprite"))
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
+
SpriteReference *const currentSprite = new SpriteReference;
currentSprite->sprite = reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content);
@@ -139,6 +139,9 @@ void MonsterDB::load()
}
else if (xmlNameEqual(spriteNode, "sound"))
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
+
std::string event = XML::getProperty(spriteNode, "event", "");
const char *filename;
filename = reinterpret_cast<const char*>(
@@ -199,6 +202,9 @@ void MonsterDB::load()
}
else if (xmlNameEqual(spriteNode, "particlefx"))
{
+ if (!spriteNode->xmlChildrenNode)
+ continue;
+
display.particles.push_back(reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content));
}