restore _created magic

This commit is contained in:
Andrew Meadows 2015-05-28 12:21:38 -07:00
parent 06ffcbf24d
commit b7e3461e1a

View file

@ -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;
}