Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -498,12 +498,12 @@ void EntityScriptingInterface::deleteEntity(QUuid id) { · 497 unmodified lines | ||
| 498 | 498 | |
| 499 | 499 | auto nodeList = DependencyManager::get<NodeList>(); |
| 500 | 500 | const QUuid myNodeID = nodeList->getSessionUUID(); |
| 501 | − auto avatarHashMap = DependencyManager::get<AvatarHashMap>(); | |
| 502 | − AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); | |
| 503 | 501 | if (entity->getClientOnly() && entity->getOwningAvatarID() != myNodeID) { |
| 504 | 502 | // don't delete other avatar's avatarEntities |
| 505 | − // If you actually own the entity but the onwership is not set because of a domain switch | |
| 506 | − // the line below make sure the entity is deleted. | |
| 503 | + // If you actually own the entity but the onwership property is not set because of a domain switch | |
| 504 | + // The lines below makes sure the entity is deleted once its properties are set. | |
| 505 | + auto avatarHashMap = DependencyManager::get<AvatarHashMap>(); | |
| 506 | + AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); | |
| 507 | 507 | myAvatar->insertDetachedEntityID(id); |
| 508 | 508 | shouldDelete = false; |
| 509 | 509 | return; |