From 2f7e346f6ac26f0a97ca49ed338c15f694fcdd8c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Sun, 2 Oct 2016 22:14:33 -0700 Subject: [PATCH 1/2] Update entity scripting interface to allow modifications to unknown entities --- libraries/entities/src/EntityScriptingInterface.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index fe7fccaece..6d15e1da65 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -386,10 +386,6 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& } }); - if (!updatedEntity) { - return QUuid(); - } - _entityTree->withReadLock([&] { EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (entity) { From c0c060ef40891113507bdd991fc8db5e101bdf8e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Sat, 9 Jul 2016 02:51:51 -0700 Subject: [PATCH 2/2] Add FIXME comment to change to allow uknown enity edits --- libraries/entities/src/EntityScriptingInterface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 6d15e1da65..4c3e365ac7 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -386,6 +386,15 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& } }); + // FIXME: We need to figure out a better way to handle this. Allowing these edits to go through potentially + // breaks avatar energy and entities that are parented. + // + // To handle cases where a script needs to edit an entity with a _known_ entity id but doesn't exist + // in the local entity tree, we need to allow those edits to go through to the server. + // if (!updatedEntity) { + // return QUuid(); + // } + _entityTree->withReadLock([&] { EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (entity) {