mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:10:49 +02:00
restore _created magic
This commit is contained in:
parent
06ffcbf24d
commit
b7e3461e1a
1 changed files with 10 additions and 3 deletions
|
@ -957,9 +957,6 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
#endif
|
#endif
|
||||||
setLastEdited(now);
|
setLastEdited(now);
|
||||||
somethingChangedNotification(); // notify derived classes that something has changed
|
somethingChangedNotification(); // notify derived classes that something has changed
|
||||||
if (_created == UNKNOWN_CREATED_TIME) {
|
|
||||||
_created = now;
|
|
||||||
}
|
|
||||||
if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) {
|
if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) {
|
||||||
// anything that sets the transform or velocity must update _lastSimulated which is used
|
// 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
|
// 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;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue