Squeezing bumper while distance grabbing now brings object to your hand

This commit is contained in:
ericrius1 2016-01-05 11:01:00 -08:00
parent 5f85e0a4c0
commit a80e77ff80

View file

@ -1119,12 +1119,15 @@ function MyController(hand) {
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity, GRABBABLE_PROPERTIES);
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedEntity, DEFAULT_GRABBABLE_DATA);
if (this.state == STATE_CONTINUE_DISTANCE_HOLDING && this.bumperSqueezed() &&
typeof grabbableData.spatialKey !== 'undefined') {
if (this.state == STATE_CONTINUE_DISTANCE_HOLDING && this.bumperSqueezed()) {
var saveGrabbedID = this.grabbedEntity;
this.release();
this.setState(STATE_EQUIP);
this.grabbedEntity = saveGrabbedID;
if (typeof grabbableData.spatialKey === 'undefined') {
Entities.editEntity(this.grabbedEntity, {position: handPosition});
}
return;
}