diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-02 00:36:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-02 00:36:52 +0300 |
commit | a724b4610ae422c224291256f36d201fa9907ccb (patch) | |
tree | 321f14e037008d2cebbcad3086e46dbe412e96fc /src/resources/monsterdb.cpp | |
parent | 7fa069aec585316c34ada298ec557c7e800bf8f3 (diff) | |
download | manaplus-a724b4610ae422c224291256f36d201fa9907ccb.tar.gz manaplus-a724b4610ae422c224291256f36d201fa9907ccb.tar.bz2 manaplus-a724b4610ae422c224291256f36d201fa9907ccb.tar.xz manaplus-a724b4610ae422c224291256f36d201fa9907ccb.zip |
Fix monsters attack with particle effect.
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r-- | src/resources/monsterdb.cpp | 12 |
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)); } |