From ec9787bae21f92251a38338ae5823aa851c5efea Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 24 Apr 2014 19:16:16 -0700 Subject: Chicken eggs and ender pearls can hit entities. Fixed warning by adding dedicated m_HasTeleported for fired arrows. --- src/Entities/ProjectileEntity.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Entities/ProjectileEntity.h') diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h index efb7ae783..002aa09a1 100644 --- a/src/Entities/ProjectileEntity.h +++ b/src/Entities/ProjectileEntity.h @@ -166,6 +166,9 @@ protected: /// Timer for client arrow position confirmation via TeleportEntity float m_HitGroundTimer; + + // Whether the arrow has already been teleported into the proper position in the ground. + bool m_HasTeleported; /// If true, the arrow is in the process of being collected - don't go to anyone else bool m_bIsCollected; @@ -205,7 +208,10 @@ protected: // cProjectileEntity overrides: 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); + // tolua_begin } ; @@ -233,6 +239,9 @@ protected: // cProjectileEntity overrides: virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override; + virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override; + + void TeleportUser(const Vector3d & a_HitPos); // tolua_begin -- cgit v1.2.3