Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -474,7 +474,7 @@ void synchronizeEditedGrabProperties(EntityItemProperties& properties, const QSt · 473 unmodified lines | |||
| 474 | } | 474 | } |
| 475 | 475 | ||
| 476 | 476 | ||
| 477 | QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties, const QString& entityHostTypeString) { | 477 | QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& properties, entity::HostType entityHostType) { |
| 478 | PROFILE_RANGE(script_entities, __FUNCTION__); | 478 | PROFILE_RANGE(script_entities, __FUNCTION__); |
| 479 | 479 | ||
| 480 | _activityTracking.addedEntityCount++; | 480 | _activityTracking.addedEntityCount++; |
| @@ -483,10 +483,10 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 2 unmodified lines | |||
| 483 | const auto sessionID = nodeList->getSessionUUID(); | 483 | const auto sessionID = nodeList->getSessionUUID(); |
| 484 | 484 | ||
| 485 | EntityItemProperties propertiesWithSimID = properties; | 485 | EntityItemProperties propertiesWithSimID = properties; |
| 486 | propertiesWithSimID.setEntityHostTypeFromString(entityHostTypeString); | 486 | propertiesWithSimID.setEntityHostType(entityHostType); |
| 487 | if (propertiesWithSimID.getEntityHostType() == entity::HostType::AVATAR) { | 487 | if (entityHostType == entity::HostType::AVATAR) { |
| 488 | propertiesWithSimID.setOwningAvatarID(sessionID); | 488 | propertiesWithSimID.setOwningAvatarID(sessionID); |
| 489 | } else if (propertiesWithSimID.getEntityHostType() == entity::HostType::LOCAL) { | 489 | } else if (entityHostType == entity::HostType::LOCAL) { |
| 490 | // For now, local entities are always collisionless | 490 | // For now, local entities are always collisionless |
| 491 | // TODO: create a separate, local physics simulation that just handles local entities (and MyAvatar?) | 491 | // TODO: create a separate, local physics simulation that just handles local entities (and MyAvatar?) |
| 492 | propertiesWithSimID.setCollisionless(true); | 492 | propertiesWithSimID.setCollisionless(true); |
| @@ -579,9 +579,9 @@ QUuid EntityScriptingInterface::cloneEntity(const QUuid& entityIDToClone) { · 86 unmodified lines | |||
| 579 | 579 | ||
| 580 | if (properties.getEntityHostType() == entity::HostType::LOCAL) { | 580 | if (properties.getEntityHostType() == entity::HostType::LOCAL) { |
| 581 | // Local entities are only cloned locally | 581 | // Local entities are only cloned locally |
| 582 | return addEntity(properties, QString("local")); | 582 | return addEntityInternal(properties, entity::HostType::LOCAL); |
| 583 | } else if (cloneAvatarEntity) { | 583 | } else if (cloneAvatarEntity) { |
| 584 | return addEntity(properties, QString("avatar")); | 584 | return addEntityInternal(properties, entity::HostType::AVATAR); |
| 585 | } else { | 585 | } else { |
| 586 | // setLastEdited timestamp to 0 to ensure this entity gets updated with the properties | 586 | // setLastEdited timestamp to 0 to ensure this entity gets updated with the properties |
| 587 | // from the server-created entity, don't change this unless you know what you are doing | 587 | // from the server-created entity, don't change this unless you know what you are doing |