summaryrefslogtreecommitdiff
path: root/src/particle/particleengine.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/particle/particleengine.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/particle/particleengine.cpp')
-rw-r--r--src/particle/particleengine.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/particle/particleengine.cpp b/src/particle/particleengine.cpp
index 2ac1d7166..51620a11e 100644
--- a/src/particle/particleengine.cpp
+++ b/src/particle/particleengine.cpp
@@ -70,7 +70,7 @@ void ParticleEngine::setupEngine() restrict2
ParticleEngine::fastPhysics = config.getIntValue("particleFastPhysics");
ParticleEngine::emitterSkip =
config.getIntValue("particleEmitterSkip") + 1;
- if (!ParticleEngine::emitterSkip)
+ if (ParticleEngine::emitterSkip == 0)
ParticleEngine::emitterSkip = 1;
ParticleEngine::enabled = config.getBoolValue("particleeffects");
logger->log1("Particle engine set up");
@@ -78,7 +78,7 @@ void ParticleEngine::setupEngine() restrict2
bool ParticleEngine::update() restrict2
{
- if (mChildParticles.empty() || !mMap)
+ if (mChildParticles.empty() || (mMap == nullptr))
return true;
// Update child particles
@@ -139,12 +139,12 @@ Particle *ParticleEngine::addEffect(const std::string &restrict
particleEffectFile.substr(0, pos),
UseVirtFs_true,
SkipError_false);
- if (!doc)
+ if (doc == nullptr)
return nullptr;
XmlNodeConstPtrConst rootNode = doc->rootNode();
- if (!rootNode || !xmlNameEqual(rootNode, "effect"))
+ if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "effect"))
{
logger->log("Error loading particle: %s", particleEffectFile.c_str());
doc->decRef();
@@ -162,20 +162,22 @@ Particle *ParticleEngine::addEffect(const std::string &restrict
XmlNodePtr node;
// Animation
- if ((node = XML::findFirstChildByName(effectChildNode, "animation")))
+ if ((node = XML::findFirstChildByName(effectChildNode, "animation")) !=
+ nullptr)
{
newParticle = new AnimationParticle(node, dyePalettes);
newParticle->setMap(mMap);
}
// Rotational
else if ((node = XML::findFirstChildByName(
- effectChildNode, "rotation")))
+ effectChildNode, "rotation")) != nullptr)
{
newParticle = new RotationalParticle(node, dyePalettes);
newParticle->setMap(mMap);
}
// Image
- else if ((node = XML::findFirstChildByName(effectChildNode, "image")))
+ else if ((node = XML::findFirstChildByName(effectChildNode,
+ "image")) != nullptr)
{
std::string imageSrc;
if (XmlHaveChildContent(node))
@@ -230,7 +232,7 @@ Particle *ParticleEngine::addEffect(const std::string &restrict
else if (xmlNameEqual(emitterNode, "deatheffect"))
{
std::string deathEffect;
- if (node && XmlHaveChildContent(node))
+ if ((node != nullptr) && XmlHaveChildContent(node))
deathEffect = XmlChildContent(emitterNode);
char deathEffectConditions = 0x00;