From d5040006040681e6fe430b07fe197c85ff9efc2f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 18 Jul 2017 16:51:21 +0100 Subject: [PATCH] made requested changes --- libraries/entities/src/EntityScriptingInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 730677d85d..2cefd647cb 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -498,12 +498,12 @@ void EntityScriptingInterface::deleteEntity(QUuid id) { auto nodeList = DependencyManager::get(); const QUuid myNodeID = nodeList->getSessionUUID(); - auto avatarHashMap = DependencyManager::get(); - AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); if (entity->getClientOnly() && entity->getOwningAvatarID() != myNodeID) { // don't delete other avatar's avatarEntities - // If you actually own the entity but the onwership is not set because of a domain switch - // the line below make sure the entity is deleted. + // If you actually own the entity but the onwership property is not set because of a domain switch + // The lines below makes sure the entity is deleted once its properties are set. + auto avatarHashMap = DependencyManager::get(); + AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); myAvatar->insertDetachedEntityID(id); shouldDelete = false; return;