diff options
author | andrew <xdotftw@gmail.com> | 2014-03-25 09:32:58 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-25 09:32:58 +0100 |
commit | 0fe1e50ffc744d861744e4aa4905e1b4b15e10fd (patch) | |
tree | 20bb1e5c88cf412a3b3edb2608c4aedb6c1e5497 /src/Mobs/Wither.cpp | |
parent | Minor fixes (diff) | |
download | cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar.gz cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar.bz2 cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar.lz cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar.xz cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.tar.zst cuberite-0fe1e50ffc744d861744e4aa4905e1b4b15e10fd.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Wither.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Mobs/Wither.cpp b/src/Mobs/Wither.cpp index 0e42194ac..790f127f2 100644 --- a/src/Mobs/Wither.cpp +++ b/src/Mobs/Wither.cpp @@ -21,6 +21,15 @@ cWither::cWither(void) : +bool cWither::IsArmored(void) const +{ + return GetHealth() <= (GetMaxHealth() / 2); +} + + + + + void cWither::DoTakeDamage(TakeDamageInfo & a_TDI) { if (a_TDI.DamageType == dtDrowning) @@ -33,6 +42,11 @@ void cWither::DoTakeDamage(TakeDamageInfo & a_TDI) return; } + if (IsArmored() && (a_TDI.DamageType == dtRangedAttack)) + { + return; + } + super::DoTakeDamage(a_TDI); } @@ -60,6 +74,8 @@ void cWither::Tick(float a_Dt, cChunk & a_Chunk) Heal(10); } } + + m_World->BroadcastEntityMetadata(*this); } |