Merge pull request #12521 from sethalves/no-prelocked-for-non-lockers

if a node can't change locks, don't allow it to create an already-locked entity
This commit is contained in:
Brad Hefta-Gaub 2018-03-01 14:56:29 -08:00 committed by GitHub
commit d24cea2f07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1508,6 +1508,12 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
}
}
if (isAdd && properties.getLocked() && !senderNode->isAllowedEditor()) {
// if a node can't change locks, don't allow them to create an already-locked entity
properties.setLocked(false);
bumpTimestamp(properties);
}
// If we got a valid edit packet, then it could be a new entity or it could be an update to
// an existing entity... handle appropriately
if (validEditPacket) {
@ -2470,4 +2476,4 @@ bool EntityTree::removeMaterialFromOverlay(const QUuid& overlayID, graphics::Mat
return _removeMaterialFromOverlayOperator(overlayID, material, parentMaterialName);
}
return false;
}
}