don't make changes to other avatar's avatarEntities

This commit is contained in:
Seth Alves 2016-05-10 16:05:40 -07:00
parent b05ab1b17e
commit 144715f00c
2 changed files with 11 additions and 0 deletions

View file

@ -284,6 +284,12 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
return;
}
auto nodeList = DependencyManager::get<NodeList>();
if (entity->getClientOnly() && entity->getOwningAvatarID() != nodeList->getSessionUUID()) {
// don't edit other avatar's avatarEntities
return;
}
if (scriptSideProperties.parentRelatedPropertyChanged()) {
// All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them.
// If any of these changed, pull any missing properties from the entity.

View file

@ -404,6 +404,11 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationStep) {
assert(_body);
assert(entityTreeIsLocked());
if (_entity->getClientOnly() && _entity->getOwningAvatarID() != Physics::getSessionUUID()) {
// don't send updates for someone else's avatarEntities
return false;
}
if (_entity->actionDataNeedsTransmit()) {
return true;
}