don't allow scaling of others' equipped entities

This commit is contained in:
Seth Alves 2019-01-03 08:15:19 -08:00
parent ad1235ce94
commit b2f25629eb

View file

@ -7,7 +7,7 @@
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
/* global Script, Vec3, MyAvatar, Entities, RIGHT_HAND */
/* global Script, Vec3, MyAvatar, Entities, RIGHT_HAND, entityIsGrabbable */
(function() {
var dispatcherUtils = Script.require("/~/system/libraries/controllerDispatcherUtils.js");
@ -62,6 +62,9 @@
var otherHandTargetProps = otherModule.getTargetProps(controllerData);
if (thisHandTargetProps && otherHandTargetProps) {
if (thisHandTargetProps.id === otherHandTargetProps.id) {
if (!entityIsGrabbable(thisHandTargetProps)) {
return dispatcherUtils.makeRunningValues(false, [], []);
}
this.grabbedThingID = thisHandTargetProps.id;
this.scalingStartDistance =
Vec3.length(Vec3.subtract(controllerData.controllerLocations[this.hand].position,