summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-02 00:36:52 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-02 00:36:52 +0300
commita724b4610ae422c224291256f36d201fa9907ccb (patch)
tree321f14e037008d2cebbcad3086e46dbe412e96fc
parent7fa069aec585316c34ada298ec557c7e800bf8f3 (diff)
downloadplus-a724b4610ae422c224291256f36d201fa9907ccb.tar.gz
plus-a724b4610ae422c224291256f36d201fa9907ccb.tar.bz2
plus-a724b4610ae422c224291256f36d201fa9907ccb.tar.xz
plus-a724b4610ae422c224291256f36d201fa9907ccb.zip
Fix monsters attack with particle effect.
-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));
}