diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-16 18:21:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-16 18:21:50 +0300 |
commit | 05942467b37990f38fc80923f3d9ec63b160ad92 (patch) | |
tree | 3c6d3c3f55f83797d0a6444f1ddbd811267eb75d /src/particle/particle.cpp | |
parent | b6e4d73c64444efa7c7bd10f09926564457ac251 (diff) | |
download | plus-05942467b37990f38fc80923f3d9ec63b160ad92.tar.gz plus-05942467b37990f38fc80923f3d9ec63b160ad92.tar.bz2 plus-05942467b37990f38fc80923f3d9ec63b160ad92.tar.xz plus-05942467b37990f38fc80923f3d9ec63b160ad92.zip |
Add missing checks.
Diffstat (limited to 'src/particle/particle.cpp')
-rw-r--r-- | src/particle/particle.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index ed8db2d27..2ad4fe728 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -329,8 +329,12 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, // Image else if ((node = XML::findFirstChildByName(effectChildNode, "image"))) { - std::string imageSrc = reinterpret_cast<const char*>( - node->xmlChildrenNode->content); + std::string imageSrc; + if (node->xmlChildrenNode) + { + imageSrc = reinterpret_cast<const char*>( + node->xmlChildrenNode->content); + } if (!imageSrc.empty() && !dyePalettes.empty()) Dye::instantiate(imageSrc, dyePalettes); Image *const img = resman->getImage(imageSrc); @@ -375,8 +379,12 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, } else if (xmlNameEqual(emitterNode, "deatheffect")) { - const std::string deathEffect = reinterpret_cast<const char*>( - emitterNode->xmlChildrenNode->content); + std::string deathEffect; + if (node->xmlChildrenNode) + { + deathEffect = reinterpret_cast<const char*>( + emitterNode->xmlChildrenNode->content); + } char deathEffectConditions = 0x00; if (XML::getBoolProperty(emitterNode, "on-floor", true)) |