From edefa27a48e2b5e7c82e74ca0e924172181fb098 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 12 Jan 2014 23:23:36 +0000 Subject: Detaching improvements * Players now search for an area around themselves to teleport to when detaching from something --- src/Entities/Entity.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Entities/Entity.cpp') 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; -- cgit v1.2.3