From b7e3461e1a7119333856f44f05c08d137b8d1948 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 28 May 2015 12:21:38 -0700 Subject: [PATCH] restore _created magic --- libraries/entities/src/EntityItem.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index e0297fe7d4..64196d1c35 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -957,9 +957,6 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) { #endif setLastEdited(now); somethingChangedNotification(); // notify derived classes that something has changed - if (_created == UNKNOWN_CREATED_TIME) { - _created = now; - } if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) { // anything that sets the transform or velocity must update _lastSimulated which is used // for kinematic extrapolation (e.g. we want to extrapolate forward from this moment @@ -968,6 +965,16 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) { } } + // timestamps + quint64 timestamp = properties.getCreated(); + if (_created == UNKNOWN_CREATED_TIME && timestamp != UNKNOWN_CREATED_TIME) { + quint64 now = usecTimestampNow(); + if (timestamp > now) { + timestamp = now; + } + _created = timestamp; + } + return somethingChanged; }