_lastEdited can only increase or be reset

This commit is contained in:
Andrew Meadows 2019-11-19 08:44:33 -08:00
parent 08263b2672
commit 3b8275c240

View file

@ -2707,10 +2707,12 @@ quint64 EntityItem::getLastEdited() const {
}
void EntityItem::setLastEdited(quint64 lastEdited) {
withWriteLock([&] {
_lastEdited = _lastUpdated = lastEdited;
_changedOnServer = glm::max(lastEdited, _changedOnServer);
});
if (lastEdited == 0 || lastEdited > _lastEdited) {
withWriteLock([&] {
_lastEdited = _lastUpdated = lastEdited;
_changedOnServer = glm::max(lastEdited, _changedOnServer);
});
}
}
void EntityItem::markAsChangedOnServer() {