summaryrefslogtreecommitdiffstats
path: root/source/Entities/ProjectileEntity.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-12 22:43:20 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-12 22:43:20 +0100
commit347162a82f2cba75c4eb7739d4405ea78de4f0b5 (patch)
tree35409f6d8f6061ae3f8fa4569c0962a8bd569186 /source/Entities/ProjectileEntity.h
parentBundled fixes [SEE DESC] (diff)
downloadcuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.gz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.bz2
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.lz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.xz
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.tar.zst
cuberite-347162a82f2cba75c4eb7739d4405ea78de4f0b5.zip
Diffstat (limited to '')
-rw-r--r--source/Entities/ProjectileEntity.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/Entities/ProjectileEntity.h b/source/Entities/ProjectileEntity.h
index 547aa174e..359b0241b 100644
--- a/source/Entities/ProjectileEntity.h
+++ b/source/Entities/ProjectileEntity.h
@@ -53,6 +53,9 @@ public:
/// Called by the physics blocktracer when the entity hits another entity
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) {}
+ /// Called by Chunk when the projectile is eligible for player collection
+ virtual void CollectedBy(cPlayer * a_Dest);
+
// tolua_begin
/// Returns the kind of the projectile (fast class identification)
@@ -80,7 +83,7 @@ protected:
/// True if the projectile has hit the ground and is stuck there
bool m_IsInGround;
-
+
// cEntity overrides:
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk) override;
@@ -153,9 +156,20 @@ protected:
/// If true, the arrow deals more damage
bool m_IsCritical;
+ /// Timer for pickup collection animation or five minute timeout
+ float m_Timer;
+
+ /// If true, the arrow is in the process of being collected - don't go to anyone else
+ bool m_bIsCollected;
+
+ /// Stores the block position that arrow is lodged into, sets m_IsInGround to false if it becomes air
+ Vector3i m_HitBlockPos;
+
// cProjectileEntity overrides:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void CollectedBy(cPlayer * a_Player) override;
+ virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
// tolua_begin
} ;