From a724b4610ae422c224291256f36d201fa9907ccb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Oct 2012 00:36:52 +0300 Subject: Fix monsters attack with particle effect. --- src/resources/monsterdb.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/resources/monsterdb.cpp') 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 s and 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( 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( @@ -199,6 +202,9 @@ void MonsterDB::load() } else if (xmlNameEqual(spriteNode, "particlefx")) { + if (!spriteNode->xmlChildrenNode) + continue; + display.particles.push_back(reinterpret_cast( spriteNode->xmlChildrenNode->content)); } -- cgit v1.2.3-70-g09d2