fix auto-updating of adjustments to worn or equipped entities

This commit is contained in:
Seth Alves 2016-02-12 06:58:44 -08:00
parent ca5525cc3f
commit 94bc1764a8

View file

@ -144,9 +144,9 @@ function AttachedEntitiesManager() {
this.handleEntityRelease = function(grabbedEntity, releasedFromJoint) { this.handleEntityRelease = function(grabbedEntity, releasedFromJoint) {
// if this is still equipped, just rewrite the position information. // if this is still equipped, just rewrite the position information.
var grabData = getEntityCustomData('grabKey', entityID, {}); var grabData = getEntityCustomData('grabKey', grabbedEntity, {});
if ("refCount" in grabData && grabData.refCount > 0) { if ("refCount" in grabData && grabData.refCount > 0) {
manager.updateRelativeOffsets(parsedMessage.grabbedEntity); manager.updateRelativeOffsets(grabbedEntity);
return; return;
} }
@ -185,8 +185,8 @@ function AttachedEntitiesManager() {
parentJointIndex: bestJointIndex parentJointIndex: bestJointIndex
}; };
if (bestJointOffset && bestJointOffset.constructor === Array && bestJointOffset.length > 1) { if (bestJointOffset && bestJointOffset.constructor === Array) {
if (this.avatarIsInDressingRoom()) { if (this.avatarIsInDressingRoom() || bestJointOffset.length < 2) {
this.updateRelativeOffsets(grabbedEntity); this.updateRelativeOffsets(grabbedEntity);
} else { } else {
// don't snap the entity to the preferred position if the avatar is in the dressing room. // don't snap the entity to the preferred position if the avatar is in the dressing room.