Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -487,6 +487,15 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr · 486 unmodified lines | |||
| 487 | 487 | ||
| 488 | _activityTracking.addedEntityCount++; | 488 | _activityTracking.addedEntityCount++; |
| 489 | 489 | ||
| 490 | auto nodeList = DependencyManager::get<NodeList>(); | ||
| 491 | |||
| 492 | if (entityHostType == entity::HostType::AVATAR && !nodeList->getThisNodeCanRezAvatarEntities()) { | ||
| 493 | qCDebug(entities) << "Ignoring addEntity() because don't have canRezAvatarEntities permission on domain"; | ||
| 494 | // Only need to intercept methods that may add an avatar entity because avatar entities are removed from the tree when | ||
| 495 | // user doesn't have canRezAvatarEntities permission. | ||
| 496 | return QUuid(); | ||
| 497 | } | ||
| 498 | |||
| 490 | EntityItemProperties propertiesWithSimID = properties; | 499 | EntityItemProperties propertiesWithSimID = properties; |
| 491 | propertiesWithSimID.setEntityHostType(entityHostType); | 500 | propertiesWithSimID.setEntityHostType(entityHostType); |
| 492 | if (entityHostType == entity::HostType::AVATAR) { | 501 | if (entityHostType == entity::HostType::AVATAR) { |
| @@ -499,7 +508,6 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr · 6 unmodified lines | |||
| 499 | } | 508 | } |
| 500 | 509 | ||
| 501 | // the created time will be set in EntityTree::addEntity by recordCreationTime() | 510 | // the created time will be set in EntityTree::addEntity by recordCreationTime() |
| 502 | auto nodeList = DependencyManager::get<NodeList>(); | ||
| 503 | auto sessionID = nodeList->getSessionUUID(); | 511 | auto sessionID = nodeList->getSessionUUID(); |
| 504 | propertiesWithSimID.setLastEditedBy(sessionID); | 512 | propertiesWithSimID.setLastEditedBy(sessionID); |
| 505 | 513 | ||