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