History

made requested changes

Dante Ruiz committed 9 years ago

Commit d5040001 parent 21d760a1 file · +4 −4Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+4−4
@@ -498,12 +498,12 @@ void EntityScriptingInterface::deleteEntity(QUuid id) { · 497 unmodified lines
498498
499499 auto nodeList = DependencyManager::get<NodeList>();
500500 const QUuid myNodeID = nodeList->getSessionUUID();
501− auto avatarHashMap = DependencyManager::get<AvatarHashMap>();
502− AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID);
503501 if (entity->getClientOnly() && entity->getOwningAvatarID() != myNodeID) {
504502 // 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);
507507 myAvatar->insertDetachedEntityID(id);
508508 shouldDelete = false;
509509 return;