fix when releaseGrab is called

This commit is contained in:
Seth Alves 2015-09-18 16:28:15 -07:00
parent 5db3af3f4c
commit 236831d385

View file

@ -380,6 +380,7 @@ function controller(hand, triggerAction) {
if (this.grabbedEntity != null && this.actionID != null) {
Entities.deleteAction(this.grabbedEntity, this.actionID);
Entities.callEntityMethod(this.grabbedEntity, "releaseGrab");
}
// the action will tend to quickly bring an object's velocity to zero. now that
@ -387,7 +388,6 @@ function controller(hand, triggerAction) {
Entities.editEntity(this.grabbedEntity,
{velocity: Vec3.multiply(this.grabbedVelocity, RELEASE_VELOCITY_MULTIPLIER)}
);
Entities.callEntityMethod(this.grabbedEntity, "releaseGrab");
this.deactivateEntity(this.grabbedEntity);
this.grabbedVelocity = ZERO_VEC;