diff options
author | archshift <admin@archshift.com> | 2014-04-25 14:39:35 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-04-25 14:39:35 +0200 |
commit | cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a (patch) | |
tree | fb0d3c5f0830c75781c5e048a89507eeed25deec | |
parent | Chicken eggs and ender pearls can hit entities. (diff) | |
download | cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar.gz cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar.bz2 cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar.lz cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar.xz cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.tar.zst cuberite-cb7f1ee4bbf726b5b57fe8d1960bb7d03dc1e87a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 7 | ||||
-rw-r--r-- | src/Entities/ProjectileEntity.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 2725822f3..89b833abf 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -440,6 +440,7 @@ cArrowEntity::cArrowEntity(cPlayer & a_Player, double a_Force) : m_IsCritical((a_Force >= 1)), m_Timer(0), m_HitGroundTimer(0), + m_HasTeleported(false), m_bIsCollected(false), m_HitBlockPos(0, 0, 0) { @@ -611,7 +612,7 @@ cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y, void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) { - TryForChicken(a_HitPos); + TrySpawnChicken(a_HitPos); Destroy(); } @@ -625,7 +626,7 @@ void cThrownEggEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_Hit int TotalDamage = 0; // TODO: If entity is Ender Crystal, destroy it - TryForChicken(a_HitPos); + TrySpawnChicken(a_HitPos); a_EntityHit.TakeDamage(dtRangedAttack, this, TotalDamage, 1); Destroy(true); @@ -635,7 +636,7 @@ void cThrownEggEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_Hit -void cThrownEggEntity::TryForChicken(const Vector3d & a_HitPos) +void cThrownEggEntity::TrySpawnChicken(const Vector3d & a_HitPos) { if (m_World->GetTickRandomNumber(7) == 1) { diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h index 002aa09a1..90d44ed91 100644 --- a/src/Entities/ProjectileEntity.h +++ b/src/Entities/ProjectileEntity.h @@ -210,7 +210,7 @@ protected: virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override; virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override; - void TryForChicken(const Vector3d & a_HitPos); + void TrySpawnChicken(const Vector3d & a_HitPos); // tolua_begin |