Combining three if statements into one!

This commit is contained in:
Cain Kilgore 2017-07-03 19:58:26 +01:00
parent bfcddcf3b7
commit 1c5923914b

View file

@ -15,9 +15,7 @@
var isRocketing = false; var isRocketing = false;
function checkRocketing() { function checkRocketing() {
if (HMD.active) { if (HMD.active && (Controller.Hardware.Vive || Controller.Hardware.OculusTouch) && canRocket()) {
if (Controller.Hardware.Vive || Controller.Hardware.OculusTouch) {
if (canRocket()) {
isRocketing = true; isRocketing = true;
MyAvatar.motorReferenceFrame = "world"; MyAvatar.motorReferenceFrame = "world";
var moveVector = Vec3.multiply(Quat.getFront(Camera.getOrientation()), 10); var moveVector = Vec3.multiply(Quat.getFront(Camera.getOrientation()), 10);
@ -29,12 +27,6 @@
} else { } else {
checkCanStopRocketing(); checkCanStopRocketing();
} }
} else {
checkCanStopRocketing();
}
} else {
checkCanStopRocketing();
}
}; };
function checkCanStopRocketing() { function checkCanStopRocketing() {