summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-14 03:23:49 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-14 03:23:49 +0300
commiteedeca17b9867762093e330d68bf21aea9e75fba (patch)
treee1acce6753ffedeff5ea4c80dc3399f6dd0260c9 /src/being.cpp
parent1a04f34a62dc82833dbe994a9f11d543b6a78928 (diff)
downloadmanaplus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.gz
manaplus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.bz2
manaplus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.xz
manaplus-eedeca17b9867762093e330d68bf21aea9e75fba.zip
Add missing checks.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp16
1 files changed, 4 insertions, 12 deletions
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)