Merge pull request #10133 from sethalves/fix-teleport-which-something-equipped

Fix teleport when something equipped
This commit is contained in:
Anthony Thibault 2017-04-09 19:00:21 -07:00 committed by GitHub
commit 746b7aadbd

View file

@ -1094,7 +1094,6 @@ function MyController(hand) {
this.grabbedOverlay = null;
this.state = STATE_OFF;
this.pointer = null; // entity-id of line object
this.entityActivated = false;
this.triggerValue = 0; // rolling average of trigger value
this.triggerClicked = false;
@ -2826,12 +2825,6 @@ function MyController(hand) {
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
if (this.entityActivated) {
var saveGrabbedID = this.grabbedThingID;
this.release();
this.grabbedThingID = saveGrabbedID;
}
var grabbedProperties;
if (this.grabbedIsOverlay) {
grabbedProperties = {
@ -3013,6 +3006,9 @@ function MyController(hand) {
_this.callEntityMethodOnGrabbed("startEquip");
}
// don't block teleport raypick with equipped entity
Messages.sendMessage('Hifi-Teleport-Ignore-Add', _this.grabbedThingID);
_this.currentHandControllerTipPosition =
(_this.hand === RIGHT_HAND) ? MyAvatar.rightHandTipPosition : MyAvatar.leftHandTipPosition;
_this.currentObjectTime = Date.now();
@ -3654,6 +3650,9 @@ function MyController(hand) {
this.turnOffVisualizations();
if (this.grabbedThingID !== null) {
Messages.sendMessage('Hifi-Teleport-Ignore-Remove', this.grabbedThingID);
if (this.state === STATE_HOLD) {
this.callEntityMethodOnGrabbed("releaseEquip");
}