diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-08-13 13:40:23 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2017-08-13 13:40:23 +0200 |
commit | 4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0 (patch) | |
tree | dfd082011c34e340de8bf71ee7af0362881ea248 /src/Entities/ArrowEntity.cpp | |
parent | Merge pull request #3897 from peterbell10/PlaceSound (diff) | |
download | cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar.gz cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar.bz2 cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar.lz cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar.xz cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.tar.zst cuberite-4dd2af27e0813e3e2e7d37eeac77ef1c0f4fd0c0.zip |
Diffstat (limited to 'src/Entities/ArrowEntity.cpp')
-rw-r--r-- | src/Entities/ArrowEntity.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index e8430090b..6259098d8 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -119,23 +119,9 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) Damage += ExtraDamage; } - // int KnockbackAmount = 1; unsigned int PunchLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPunch); - if (PunchLevel > 0) - { - Vector3d LookVector = GetLookVector(); - Vector3f FinalSpeed = Vector3f(0, 0, 0); - switch (PunchLevel) - { - case 1: FinalSpeed = LookVector * Vector3d(5, 0.3, 5); break; - case 2: FinalSpeed = LookVector * Vector3d(8, 0.3, 8); break; - default: break; - } - a_EntityHit.SetSpeed(FinalSpeed); - } - - // a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, KnockbackAmount); // TODO fix knockback. - a_EntityHit.TakeDamage(dtRangedAttack, GetCreatorUniqueID(), Damage, 0); // Until knockback is fixed. + double KnockbackAmount = 11 + 10 * PunchLevel; + a_EntityHit.TakeDamage(dtRangedAttack, GetCreatorUniqueID(), Damage, KnockbackAmount); if (IsOnFire() && !a_EntityHit.IsSubmerged() && !a_EntityHit.IsSwimming()) { |