summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 23:13:25 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 23:13:25 +0200
commit00febf68ad8bc36546c02b0c0b926189fb3955a1 (patch)
treec10896365ce99cd0e22f9398908b094ea5114e9e /src/Entities
parentAgressives wander and don't crash (diff)
downloadcuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.gz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.bz2
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.lz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.xz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.zst
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Entity.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 347c0ec91..ccba28d53 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -239,7 +239,9 @@ void cEntity::Destroy(bool a_ShouldBroadcast)
}
cChunk * ParentChunk = GetParentChunk();
- m_World->QueueTask([this, ParentChunk](cWorld & a_World)
+ // Destroy the entity after two seconds, to give time for all raw pointers such as m_Target
+ // to de-target this entity. This is a temporary solution.
+ m_World->ScheduleTask(40, [this, ParentChunk](cWorld & a_World)
{
LOGD("Destroying entity #%i (%s) from chunk (%d, %d)",
this->GetUniqueID(), this->GetClass(),