diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-29 23:13:25 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-29 23:13:25 +0200 |
commit | 00febf68ad8bc36546c02b0c0b926189fb3955a1 (patch) | |
tree | c10896365ce99cd0e22f9398908b094ea5114e9e /src/Entities | |
parent | Agressives wander and don't crash (diff) | |
download | cuberite-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.cpp | 4 |
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(), |