diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 70be7a4d66..2a0fb893cf 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -3237,13 +3237,12 @@ void EntityItem::retrieveMarketplacePublicKey() { void EntityItem::collectChildrenForDelete(std::vector& entitiesToDelete, const QUuid& sessionID) const { // Deleting an entity has consequences for its children, however there are rules dictating what can be deleted. - // This method helps enforce those rules for the children of entity (not for this entity). + // This method helps enforce those rules: not for this entity, but for its children. for (SpatiallyNestablePointer child : getChildren()) { if (child && child->getNestableType() == NestableType::Entity) { EntityItemPointer childEntity = std::static_pointer_cast(child); - // NOTE: null sessionID means "collect ALL known entities", else we only collect: local-entities and authorized avatar-entities - if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() && - (childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) { + // NOTE: null sessionID means "collect ALL known children", else we only collect: local-entities and myAvatar-entities + if (sessionID.isNull() || childEntity->isLocalEntity() || childEntity->isMyAvatarEntity()) { if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) { entitiesToDelete.push_back(childEntity); childEntity->collectChildrenForDelete(entitiesToDelete, sessionID); @@ -3417,7 +3416,7 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti properties.setSimulationOwner(Physics::getSessionUUID(), priority); setPendingOwnershipPriority(priority); - // ANDREW TODO: figure out if it would be OK to NOT bother set these properties here + // TODO: figure out if it would be OK to NOT bother set these properties here properties.setEntityHostType(getEntityHostType()); properties.setOwningAvatarID(getOwningAvatarID()); setLastBroadcast(now); // for debug/physics status icons