summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-04-26 00:32:30 +0200
committerHowaner <franzi.moos@googlemail.com>2014-04-26 00:32:30 +0200
commit7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f (patch)
treec06c0e15699d0a120820176fe979dcbceb63b8b0 /src/Mobs/Monster.cpp
parentMerge pull request #935 from archshift/projectile-fixes (diff)
downloadcuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar.gz
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar.bz2
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar.lz
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar.xz
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.tar.zst
cuberite-7e76f030aa2e6d39ac7fe9fb6a8a3db44bf3dd5f.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index eb8480268..9e4c2ba25 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -457,9 +457,12 @@ int cMonster::FindFirstNonAirBlockPosition(double a_PosX, double a_PosZ)
-void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
+bool cMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
{
- super::DoTakeDamage(a_TDI);
+ if (!super::DoTakeDamage(a_TDI))
+ {
+ return false;
+ }
if((m_SoundHurt != "") && (m_Health > 0))
m_World->BroadcastSoundEffect(m_SoundHurt, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
@@ -468,6 +471,7 @@ void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
{
m_Target = a_TDI.Attacker;
}
+ return true;
}