mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 21:43:13 +02:00
don't dirty motion-type if lock value isn't actually changing
This commit is contained in:
parent
8f38ea8c6a
commit
2512b39848
1 changed files with 11 additions and 5 deletions
|
@ -2764,13 +2764,19 @@ bool EntityItem::getLocked() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::setLocked(bool value) {
|
void EntityItem::setLocked(bool value) {
|
||||||
|
bool changed { false };
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_locked = value;
|
if (_locked != value) {
|
||||||
|
_locked = value;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
if (changed) {
|
||||||
EntityTreePointer tree = getTree();
|
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||||
if (tree) {
|
EntityTreePointer tree = getTree();
|
||||||
tree->entityChanged(getThisPointer());
|
if (tree) {
|
||||||
|
tree->entityChanged(getThisPointer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue