diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 9f06b0d661..80ac715994 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -986,8 +986,8 @@ bool EntityItem::isMoving() const { } EntityTreePointer EntityItem::getTree() const { - EntityTreeElementPointer elt = getElement(); - EntityTreePointer tree = elt ? elt->getTree() : nullptr; + EntityTreeElementPointer containingElement = getElement(); + EntityTreePointer tree = containingElement ? containingElement->getTree() : nullptr; return tree; } diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index fd099344ba..2e01d7f774 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -47,14 +47,14 @@ bool EntityScriptingInterface::canRez() { return nodeList->getThisNodeCanRez(); } -void EntityScriptingInterface::setEntityTree(EntityTreePointer modelTree) { +void EntityScriptingInterface::setEntityTree(EntityTreePointer elementTree) { if (_entityTree) { disconnect(_entityTree.get(), &EntityTree::addingEntity, this, &EntityScriptingInterface::addingEntity); disconnect(_entityTree.get(), &EntityTree::deletingEntity, this, &EntityScriptingInterface::deletingEntity); disconnect(_entityTree.get(), &EntityTree::clearingEntities, this, &EntityScriptingInterface::clearingEntities); } - _entityTree = modelTree; + _entityTree = elementTree; if (_entityTree) { connect(_entityTree.get(), &EntityTree::addingEntity, this, &EntityScriptingInterface::addingEntity); diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 26c6cd2f0b..10e5ea5a39 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -45,9 +45,9 @@ void EntityTree::createRootElement() { OctreeElementPointer EntityTree::createNewElement(unsigned char* octalCode) { EntityTreeElementPointer newElement = EntityTreeElementPointer(new EntityTreeElement(octalCode), // see comment int EntityTreeElement::createNewElement - [=](EntityTreeElement* elt) { - EntityTreeElementPointer tmpSharedPointer(elt); - elt->notifyDeleteHooks(); + [=](EntityTreeElement* dyingElement) { + EntityTreeElementPointer tmpSharedPointer(dyingElement); + dyingElement->notifyDeleteHooks(); }); newElement->setTree(std::static_pointer_cast(shared_from_this())); return std::static_pointer_cast(newElement); diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 536c3d6d9f..9a31c18219 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -42,12 +42,12 @@ OctreeElementPointer EntityTreeElement::createNewElement(unsigned char* octalCod // or the destructor wouldn't have been called). The destructor also can't // make a new shared pointer -- shared_from_this() is forbidden in a destructor, and // using OctreeElementPointer(this) also fails. So, I've installed a custom deleter: - [=](EntityTreeElement* elt) { + [=](EntityTreeElement* dyingElement) { // make a new shared pointer with a reference count of 1 (and no custom deleter) - EntityTreeElementPointer tmpSharedPointer(elt); + EntityTreeElementPointer tmpSharedPointer(dyingElement); // call notifyDeleteHooks which will use shared_from_this() to get this same // shared pointer, for use with the elementDeleted calls. - elt->notifyDeleteHooks(); + dyingElement->notifyDeleteHooks(); // And now tmpSharedPointer's reference count drops to zero and the // normal destructors are called. });