Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 619 files). Show all
Unified · Split
| @@ -490,6 +490,8 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 489 unmodified lines | |||
| 490 | 490 | ||
| 491 | propertiesWithSimID.setLastEditedBy(sessionID); | 491 | propertiesWithSimID.setLastEditedBy(sessionID); |
| 492 | 492 | ||
| 493 | propertiesWithSimID.setActionData(QByteArray()); | ||
| 494 | |||
| 493 | bool scalesWithParent = propertiesWithSimID.getScalesWithParent(); | 495 | bool scalesWithParent = propertiesWithSimID.getScalesWithParent(); |
| 494 | 496 | ||
| 495 | propertiesWithSimID = convertPropertiesFromScriptSemantics(propertiesWithSimID, scalesWithParent); | 497 | propertiesWithSimID = convertPropertiesFromScriptSemantics(propertiesWithSimID, scalesWithParent); |
| @@ -845,6 +847,8 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 349 unmodified lines | |||
| 845 | } | 847 | } |
| 846 | properties.setOwningAvatarID(entity->getOwningAvatarID()); | 848 | properties.setOwningAvatarID(entity->getOwningAvatarID()); |
| 847 | 849 | ||
| 850 | properties.setActionData(entity->getDynamicData()); | ||
| 851 | |||
| 848 | // make sure the properties has a type, so that the encode can know which properties to include | 852 | // make sure the properties has a type, so that the encode can know which properties to include |
| 849 | properties.setType(entity->getType()); | 853 | properties.setType(entity->getType()); |
| 850 | 854 | ||
| @@ -969,11 +973,6 @@ void EntityScriptingInterface::deleteEntity(QUuid id) { · 118 unmodified lines | |||
| 969 | const QUuid myNodeID = nodeList->getSessionUUID(); | 973 | const QUuid myNodeID = nodeList->getSessionUUID(); |
| 970 | if (entity->isAvatarEntity() && entity->getOwningAvatarID() != myNodeID) { | 974 | if (entity->isAvatarEntity() && entity->getOwningAvatarID() != myNodeID) { |
| 971 | // don't delete other avatar's avatarEntities | 975 | // don't delete other avatar's avatarEntities |
| 972 | // If you actually own the entity but the onwership property is not set because of a domain switch | ||
| 973 | // The lines below makes sure the entity is deleted once its properties are set. | ||
| 974 | auto avatarHashMap = DependencyManager::get<AvatarHashMap>(); | ||
| 975 | AvatarSharedPointer myAvatar = avatarHashMap->getAvatarBySessionID(myNodeID); | ||
| 976 | myAvatar->insertDetachedEntityID(id); | ||
| 977 | shouldSendDeleteToServer = false; | 976 | shouldSendDeleteToServer = false; |
| 978 | return; | 977 | return; |
| 979 | } | 978 | } |