mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 08:56:57 +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) {
|
||||
bool changed { false };
|
||||
withWriteLock([&] {
|
||||
_locked = value;
|
||||
if (_locked != value) {
|
||||
_locked = value;
|
||||
changed = true;
|
||||
}
|
||||
});
|
||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||
EntityTreePointer tree = getTree();
|
||||
if (tree) {
|
||||
tree->entityChanged(getThisPointer());
|
||||
if (changed) {
|
||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||
EntityTreePointer tree = getTree();
|
||||
if (tree) {
|
||||
tree->entityChanged(getThisPointer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue