summaryrefslogtreecommitdiffstats
path: root/src/Entities/ThrownEnderPearlEntity.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-22 21:44:01 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-22 21:44:01 +0200
commit33cc1f2a50d870b7d264ee5479068f8eee3aa458 (patch)
tree1f2d80ea19911c620b5ce17efe502fcb3bc81da0 /src/Entities/ThrownEnderPearlEntity.h
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar.gz
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar.bz2
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar.lz
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar.xz
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.tar.zst
cuberite-33cc1f2a50d870b7d264ee5479068f8eee3aa458.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/ThrownEnderPearlEntity.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Entities/ThrownEnderPearlEntity.h b/src/Entities/ThrownEnderPearlEntity.h
index ddee5babe..bfd9bd70d 100644
--- a/src/Entities/ThrownEnderPearlEntity.h
+++ b/src/Entities/ThrownEnderPearlEntity.h
@@ -30,8 +30,26 @@ 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;
-
- // Teleports the creator where the ender pearl lands.
+ virtual void Tick (float a_Dt, cChunk & a_Chunk) override
+ {
+ if (m_DestroyTimer > 0)
+ {
+ m_DestroyTimer--;
+ if (m_DestroyTimer == 0)
+ {
+ Destroy();
+ return;
+ }
+ }
+ else { super::Tick(a_Dt, a_Chunk); }
+ }
+
+ /** Teleports the creator where the ender pearl lands */
void TeleportCreator(const Vector3d & a_HitPos);
+
+private:
+
+ /** Time in ticks to wait for the hit animation to begin before destroying */
+ int m_DestroyTimer;
} ; // tolua_export