summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-14 22:46:15 +0200
committerarchshift <admin@archshift.com>2014-07-14 22:46:43 +0200
commit061010288a99fd11f91bf713ac68068c57f79be7 (patch)
treec5942dcf3c9b95e44fc32d38772069d34ea38c86 /src/Entities/Entity.cpp
parentOnEntityAddEffect.lua: Removed Originator param (diff)
downloadcuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar.gz
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar.bz2
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar.lz
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar.xz
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.tar.zst
cuberite-061010288a99fd11f91bf713ac68068c57f79be7.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 042c4b4c3..670e8420a 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -311,10 +311,13 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
// IsOnGround() only is false if the player is moving downwards
// TODO: Better damage increase, and check for enchantments (and use magic critical instead of plain)
- if (!Player->IsOnGround() && (a_TDI.DamageType == dtAttack || a_TDI.DamageType == dtArrowAttack))
+ if (!Player->IsOnGround())
{
- a_TDI.FinalDamage += 2;
- m_World->BroadcastEntityAnimation(*this, 4); // Critical hit
+ if ((a_TDI.DamageType == dtAttack) || (a_TDI.DamageType == dtArrowAttack))
+ {
+ a_TDI.FinalDamage += 2;
+ m_World->BroadcastEntityAnimation(*this, 4); // Critical hit
+ }
}
Player->GetStatManager().AddValue(statDamageDealt, (StatValue)floor(a_TDI.FinalDamage * 10 + 0.5));