Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -86,6 +86,7 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro · 85 unmodified lines | ||
| 86 | 86 | if (_entityTree) { |
| 87 | 87 | _entityTree->lockForWrite(); |
| 88 | 88 | EntityItem* entity = _entityTree->addEntity(id, propertiesWithSimID); |
| 89 | + entity->setLastBroadcast(usecTimestampNow()); | |
| 89 | 90 | if (entity) { |
| 90 | 91 | // This Node is creating a new object. If it's in motion, set this Node as the simulator. |
| 91 | 92 | setSimId(propertiesWithSimID, entity); |
| @@ -178,6 +179,7 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 86 unmodified lines | ||
| 178 | 179 | if (propertiesWithSimID.getType() == EntityTypes::Unknown) { |
| 179 | 180 | EntityItem* entity = _entityTree->findEntityByEntityItemID(entityID); |
| 180 | 181 | if (entity) { |
| 182 | + entity->setLastBroadcast(usecTimestampNow()); | |
| 181 | 183 | propertiesWithSimID.setType(entity->getType()); |
| 182 | 184 | setSimId(propertiesWithSimID, entity); |
| 183 | 185 | } |