diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-05-04 00:52:15 +0200 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-05-04 00:52:15 +0200 |
commit | 475e82064aad752d077cf1071b967b149a5ae179 (patch) | |
tree | 430d5b5399ad91e2a1d0006f87425f301c069d6d /src/being.cpp | |
parent | 1690ecb3e05e9667c6876939a338a8856bb21096 (diff) | |
download | mana-475e82064aad752d077cf1071b967b149a5ae179.tar.gz mana-475e82064aad752d077cf1071b967b149a5ae179.tar.bz2 mana-475e82064aad752d077cf1071b967b149a5ae179.tar.xz mana-475e82064aad752d077cf1071b967b149a5ae179.zip |
Prevented crash when arrow particle effect does not exist or has an error.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/being.cpp b/src/being.cpp index ab3860a0..a755ffb8 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -483,9 +483,12 @@ void Being::handleAttack(Being *victim, int damage, AttackType type) victim->controlParticle(p); Particle *p2 = particleEngine->addEffect("graphics/particles/arrow.particle.xml", mPx, mPy); - p2->setLifetime(900); - p2->setDestination(p, 7, 0); - p2->setDieDistance(8); + if (p2) + { + p2->setLifetime(900); + p2->setDestination(p, 7, 0); + p2->setDieDistance(8); + } } } mFrame = 0; |