Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -21,6 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <VariantMapToScriptValue.h> | 21 | #include <VariantMapToScriptValue.h> |
| 22 | #include <SharedUtil.h> | 22 | #include <SharedUtil.h> |
| 23 | #include <SpatialParentFinder.h> | 23 | #include <SpatialParentFinder.h> |
| 24 | #include <AvatarHashMap.h> | ||
| 24 | 25 | ||
| 25 | #include "EntityItemID.h" | 26 | #include "EntityItemID.h" |
| 26 | #include "EntitiesLogging.h" | 27 | #include "EntitiesLogging.h" |
| @@ -497,8 +498,11 @@ void EntityScriptingInterface::deleteEntity(QUuid id) { · 470 unmodified lines | |||
| 497 | 498 | ||
| 498 | auto nodeList = DependencyManager::get<NodeList>(); | 499 | auto nodeList = DependencyManager::get<NodeList>(); |
| 499 | const QUuid myNodeID = nodeList->getSessionUUID(); | 500 | const QUuid myNodeID = nodeList->getSessionUUID(); |
| 501 | auto avatarHashMap = DependencyManager::get<AvatarHashMap>(); | ||
| 502 | AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); | ||
| 500 | if (entity->getClientOnly() && entity->getOwningAvatarID() != myNodeID) { | 503 | if (entity->getClientOnly() && entity->getOwningAvatarID() != myNodeID) { |
| 501 | // don't delete other avatar's avatarEntities | 504 | // don't delete other avatar's avatarEntities |
| 505 | myAvatar->insertDetachedEntityID(id); | ||
| 502 | shouldDelete = false; | 506 | shouldDelete = false; |
| 503 | return; | 507 | return; |
| 504 | } | 508 | } |