move isInEditMode guard to setState

This commit is contained in:
humbletim 2017-01-23 01:31:11 -05:00
parent 15394056eb
commit d20ac20ff2

View file

@ -842,14 +842,14 @@ function MyController(hand) {
};
this.callEntityMethodOnGrabbed = function(entityMethodName) {
if (isInEditMode()) {
return;
}
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
Entities.callEntityMethod(this.grabbedEntity, entityMethodName, args);
};
this.setState = function(newState, reason) {
if (isInEditMode() && newState !== STATE_OFF && newState !== STATE_SEARCHING) {
return;
}
setGrabCommunications((newState === STATE_DISTANCE_HOLDING) || (newState === STATE_NEAR_GRABBING));
if (WANT_DEBUG || WANT_DEBUG_STATE) {
var oldStateName = stateToName(this.state);