don't dirty motion-type if lock value isn't actually changing

This commit is contained in:
Seth Alves 2017-05-20 14:14:33 -07:00
parent 8f38ea8c6a
commit 2512b39848

View file

@ -2764,15 +2764,21 @@ bool EntityItem::getLocked() const {
}
void EntityItem::setLocked(bool value) {
bool changed { false };
withWriteLock([&] {
if (_locked != value) {
_locked = value;
changed = true;
}
});
if (changed) {
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
EntityTreePointer tree = getTree();
if (tree) {
tree->entityChanged(getThisPointer());
}
}
}
QString EntityItem::getUserData() const {
QString result;