diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-13 00:23:36 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-13 00:23:36 +0100 |
commit | edefa27a48e2b5e7c82e74ca0e924172181fb098 (patch) | |
tree | 5d0a89e0bf234ee80adbdfd83e1d104008339edd /src/Entities/Entity.cpp | |
parent | Fixed wire, rail, and pressure plate unpowering (diff) | |
download | cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar.gz cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar.bz2 cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar.lz cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar.xz cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.tar.zst cuberite-edefa27a48e2b5e7c82e74ca0e924172181fb098.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Entity.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index fbf76e008..bc66305b1 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1107,9 +1107,11 @@ void cEntity::AttachTo(cEntity * a_AttachTo) // Already attached to that entity, nothing to do here return; } - - // Detach from any previous entity: - Detach(); + if (m_AttachedTo != NULL) + { + // Detach from any previous entity: + Detach(); + } // Attach to the new entity: m_AttachedTo = a_AttachTo; |