summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:39:25 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:39:25 +0200
commit88c877f79c37e7485f0c4cfa1ab103ed73e4f551 (patch)
treedfaa3c6349c91fc70d8b351496a9c0b3d8d12784 /src/Entities/Entity.cpp
parentAdded destroy-timer system to splash potion entities (diff)
parentAdded m_TicksAlive to entities, allows projectiles to hit their creators (diff)
downloadcuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.gz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.bz2
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.lz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.xz
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.tar.zst
cuberite-88c877f79c37e7485f0c4cfa1ab103ed73e4f551.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index f9331ede8..5a3bbcdc4 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -49,6 +49,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
, m_IsSubmerged(false)
, m_AirLevel(0)
, m_AirTickTimer(0)
+ , m_TicksAlive(0)
, m_HeadYaw(0.0)
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
@@ -559,6 +560,8 @@ void cEntity::SetHealth(int a_Health)
void cEntity::Tick(float a_Dt, cChunk & a_Chunk)
{
+ m_TicksAlive++;
+
if (m_InvulnerableTicks > 0)
{
m_InvulnerableTicks--;