Stop incrementing counter after limit reached

This commit is contained in:
David Rowe 2014-11-26 12:03:27 -08:00
parent 5f58c76842
commit 5871ecd85c

View file

@ -471,17 +471,20 @@ var leapHands = (function () {
} else { } else {
hands[h].inactiveCount += 1; if (hands[h].inactiveCount < MAX_HAND_INACTIVE_COUNT) {
if (hands[h].inactiveCount === MAX_HAND_INACTIVE_COUNT) { hands[h].inactiveCount += 1;
if (h === 0) {
MyAvatar.clearJointData("LeftHand"); if (hands[h].inactiveCount === MAX_HAND_INACTIVE_COUNT) {
MyAvatar.clearJointData("LeftForeArm"); if (h === 0) {
MyAvatar.clearJointData("LeftArm"); MyAvatar.clearJointData("LeftHand");
} else { MyAvatar.clearJointData("LeftForeArm");
MyAvatar.clearJointData("RightHand"); MyAvatar.clearJointData("LeftArm");
MyAvatar.clearJointData("RightForeArm"); } else {
MyAvatar.clearJointData("RightArm"); MyAvatar.clearJointData("RightHand");
MyAvatar.clearJointData("RightForeArm");
MyAvatar.clearJointData("RightArm");
}
} }
} }
} }