summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-09-03 13:31:27 +0200
committerGitHub <noreply@github.com>2016-09-03 13:31:27 +0200
commit90be4e7efdb455dc4bf4e150c403586a5c73d3f1 (patch)
tree4538de89307638a25566f4425e4f3b2333dd7520 /src/Entities
parentImprove cPlayer::DoMoveToWorld (#3113) (diff)
downloadcuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar.gz
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar.bz2
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar.lz
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar.xz
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.tar.zst
cuberite-90be4e7efdb455dc4bf4e150c403586a5c73d3f1.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/ArrowEntity.cpp5
-rw-r--r--src/Entities/Boat.cpp5
-rw-r--r--src/Entities/FireworkEntity.cpp5
-rw-r--r--src/Entities/Minecart.cpp5
-rw-r--r--src/Entities/Pawn.cpp6
-rw-r--r--src/Entities/Pickup.cpp5
-rw-r--r--src/Entities/ProjectileEntity.cpp5
-rw-r--r--src/Entities/TNTEntity.cpp5
8 files changed, 40 insertions, 1 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp
index 59d742f8d..366592549 100644
--- a/src/Entities/ArrowEntity.cpp
+++ b/src/Entities/ArrowEntity.cpp
@@ -180,6 +180,11 @@ void cArrowEntity::CollectedBy(cPlayer & a_Dest)
void cArrowEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
m_Timer += a_Dt;
if (m_bIsCollected)
diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp
index 330e54740..f9b83eee5 100644
--- a/src/Entities/Boat.cpp
+++ b/src/Entities/Boat.cpp
@@ -102,6 +102,11 @@ void cBoat::OnRightClicked(cPlayer & a_Player)
void cBoat::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
BroadcastMovementUpdate();
SetSpeed(GetSpeed() * 0.97); // Slowly decrease the speed
diff --git a/src/Entities/FireworkEntity.cpp b/src/Entities/FireworkEntity.cpp
index 552549b7c..b0ba4e6c5 100644
--- a/src/Entities/FireworkEntity.cpp
+++ b/src/Entities/FireworkEntity.cpp
@@ -65,6 +65,11 @@ void cFireworkEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_C
void cFireworkEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
if (m_TicksToExplosion <= 0)
{
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 3b58a1ef9..43291bdc8 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -1264,6 +1264,11 @@ void cMinecartWithFurnace::OnRightClicked(cPlayer & a_Player)
void cMinecartWithFurnace::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
if (m_IsFueled)
{
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 04425dd51..dbcaba591 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -111,7 +111,11 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
m_World->ForEachEntityInBox(cBoundingBox(GetPosition(), GetWidth(), GetHeight()), Callback);
super::Tick(a_Dt, a_Chunk);
-
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
HandleFalling();
}
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index 69bb981e6..12d535f84 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -116,6 +116,11 @@ void cPickup::SpawnOn(cClientHandle & a_Client)
void cPickup::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
BroadcastMovementUpdate(); // Notify clients of position
m_Timer += a_Dt;
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index c4f705668..2f90a56cb 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -369,6 +369,11 @@ AString cProjectileEntity::GetMCAClassName(void) const
void cProjectileEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
BroadcastMovementUpdate();
}
diff --git a/src/Entities/TNTEntity.cpp b/src/Entities/TNTEntity.cpp
index 4d533ebe4..6784f19f5 100644
--- a/src/Entities/TNTEntity.cpp
+++ b/src/Entities/TNTEntity.cpp
@@ -57,6 +57,11 @@ void cTNTEntity::Explode(void)
void cTNTEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+ if (!IsTicking())
+ {
+ // The base class tick destroyed us
+ return;
+ }
BroadcastMovementUpdate();
m_FuseTicks -= 1;