From eedeca17b9867762093e330d68bf21aea9e75fba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 14 May 2011 03:23:49 +0300 Subject: Add missing checks. --- src/being.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 383d392f8..688e838ee 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -522,7 +522,6 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) } else if (!amount) { - if (attacker == player_node) { // This is intended to be the wrong direction to visually @@ -581,8 +580,7 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) { // Show damage number particleEngine->addTextSplashEffect(damage, - getPixelX(), getPixelY() - 16, - color, font, true); + getPixelX(), getPixelY() - 16, color, font, true); } attacker->updateHit(amount); @@ -595,15 +593,9 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) mDamageTaken += amount; if (mInfo) { - if (attacker) - { - sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT), - attacker->getTileX(), attacker->getTileY()); - } - else - { - sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT)); - } + sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT), + attacker->getTileX(), attacker->getTileY()); + if (!mInfo->isStaticMaxHP()) { if (!mHP && mInfo->getMaxHP() < mDamageTaken) -- cgit v1.2.3-60-g2f50