From 475e82064aad752d077cf1071b967b149a5ae179 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Mon, 4 May 2009 00:52:15 +0200 Subject: Prevented crash when arrow particle effect does not exist or has an error. --- src/being.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/being.cpp') 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; -- cgit v1.2.3-60-g2f50