Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -333,7 +333,9 @@ QUuid EntityScriptingInterface::cloneEntity(QUuid entityIDToClone) { · 332 unmodified lines | |||
| 333 | EntityItemID newEntityID; | 333 | EntityItemID newEntityID; |
| 334 | EntityItemProperties properties = getEntityProperties(entityIDToClone); | 334 | EntityItemProperties properties = getEntityProperties(entityIDToClone); |
| 335 | properties.convertToCloneProperties(entityIDToClone); | 335 | properties.convertToCloneProperties(entityIDToClone); |
| 336 | properties.setLastEdited(0); // to ensure we take the properties from the server-created entity | 336 | // setLastEdited timestamp to 0 to ensure this entity gets updated with the properties |
| 337 | // from the server-created entity, don't change this unless you know what you are doing | ||
| 338 | properties.setLastEdited(0); | ||
| 337 | bool success = addLocalEntityCopy(properties, newEntityID); | 339 | bool success = addLocalEntityCopy(properties, newEntityID); |
| 338 | if (success) { | 340 | if (success) { |
| 339 | getEntityPacketSender()->queueCloneEntityMessage(entityIDToClone, newEntityID); | 341 | getEntityPacketSender()->queueCloneEntityMessage(entityIDToClone, newEntityID); |